kapso
kapso

Reputation: 11903

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.

Upvotes: 4

Views: 3450

Answers (1)

Jordan Running
Jordan Running

Reputation: 106027

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.

Upvotes: 10

Related Questions