Rails 3 - set environment Rails 3 - set environment ruby ruby

Rails 3 - set environment


Rails 3 is a little bit different than Rails 2.x in that it has a config.ru file, like other Rack applications.

Passenger detects rails as a Rack app, so you'll have to use RackEnv instead of RailsEnv in the vhost. You can set the environment using RackEnv as per the documentation for Passenger/Nginx.


You can configure a different RAILS_ENV for each app in your vhost for nginx with passenger. I've never used nginx but in apache it's just a RailsEnv=development directive. That way each site just has it set, no worries with configuring a cap task or variable or anything. See the docs. Note that the default is production so this should already be set for you.