So开发者_JAVA技巧 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?
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.)
加载中,请稍侯......
精彩评论