kapso
kapso

Reputation: 11903

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

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?

Upvotes: 2

Views: 2154

Answers (1)

mipadi
mipadi

Reputation: 411022

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

Upvotes: 3

Related Questions