Unicorn.rb configuration based on environment

I have a line in config / unicorn.rb that looks like this:

working_directory "/SomePath/Web\ Development/Rails/learning"

but in a production environment this has to be a different way. I want me to keep everything I could under the control of the source (I have not had to give up anything yet). Is there any way to install working_directorybased on the environment?

+5
source share
3 answers

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).

+3
source

Use unicorn_railsmakes environment variables available.

+3

RAILS_ENV.

0

All Articles