I've got a line in config/unicorn.rb that looks like so:
working_directory "/SomePath/Web\ Development/Rails/learning"
but in the production environment, it needs to be a different path. I want do keep as much as I can under source control (haven't had to give up anything yet). Is there a way to set the working_directory
based upon the environment?
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 unicorn the "-E" flag (I can't remember which for sure, but I think it's RACK_ENV).
Using unicorn_rails
makes the environment variables available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With