Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am trying to setup a staging env for my app on Heroku. And everytime I push my repo it deploys/runs the application in production mode. What do I need to do to make the app run in some other mode.

like image 541
kapso Avatar asked Dec 28 '22 12:12

kapso


1 Answers

See the last section in this Heroku article on Configuration and Config Vars.

In brief, though:

$ heroku config:add RACK_ENV=staging RAILS_ENV=staging

Also be careful not to miss the note that accompanies that section:

You should never set RACK_ENV=development, as that will enable reloading and slow down your app’s dyno significantly.

like image 104
Jordan Running Avatar answered Jan 05 '23 17:01

Jordan Running