开发者

How to switch env (test, dev, prod) when deploying rails app

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜