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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You set the environment variable
RAILS_ENVtoproductionordevelopment. You can do that through Phusion Passenger’sRailsEnvsetting (assuming you’re using Phusion Passenger, and if you aren’t, why aren’t you? 🙂 ), or through Apache’sSetEnvparameter, or using the configuration parameter of whatever server you’re running on.(If you’re using Phusion Passenger,
RailsEnvis set toproductionby default.)