Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Set RAILS_ENV Permanently

I am trying to deploy my rails app to my production server. However my app won't use any of my production config.

I am manually setting RAILS_ENV using:

export RAILS_ENV=production

Then when I run echo $RAILS_ENV I am returned production but only for that bash session. I have also added export RAILS_ENV=production in my .bashrc file, however still when I echo rails_env it returns blank. This means that when my rails app runs it uses development config.

How can I set this so that my rails app will use my production config? Preferably so that it is permanent so that I don't have to keep setting it.

Thanks!

like image 931
Jaeren Coathup Avatar asked May 05 '15 20:05

Jaeren Coathup


1 Answers

To make it system wide, add it to the /etc/profile file, or create a new file in /etc/profile.d and add as

export RAILS_ENV=production
like image 83
Scott 'scm6079' Avatar answered Nov 14 '22 21:11

Scott 'scm6079'