views:

26

answers:

1

So where does Rails pick up the environment context (dev, test, prod).

Lets say i am taking my Rails code to a prod server, how do i tell rails to use the prod env file/properties?

A: 

You set the environment variable RAILS_ENV to production or development. You can do that through Phusion Passenger's RailsEnv setting (assuming you're using Phusion Passenger, and if you aren't, why aren't you? :) ), or through Apache's SetEnv parameter, or using the configuration parameter of whatever server you're running on.

(If you're using Phusion Passenger, RailsEnv is set to production by default.)

mipadi
Because passenger is not a silver-bullet.
jpartogi
yea i just deployed using passenger. Where can i find RAILS_ENV?Also does passenger overwrite RAILS_ENV property by default?
ok sorry got it, i just read "environment variable" - RAILS_ENV. So passenger's RailsEnv directive overide the environment variable
sorry i had a long day, i get it. thanks.