开发者

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

开发者 https://www.devze.com 2023-01-07 18:38 出处:网络
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

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

精彩评论

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

关注公众号