How are you trying to access RAILS_ENV or RACK_ENV? It should be through "ENV", like ...
ENV['RAILS_ENV']
... or...
ENV['RACK_ENV']
One or the other should be available when you pass the "-E" flag to the unicorn (I can't remember what exactly, but I think it's RACK_ENV).
source
share