-
Notifications
You must be signed in to change notification settings - Fork 45
Setup staging environment with Rails
The intention of this guide is to mimic a production environment while having production configuration isolated on its own file when working with a Rails application.
- You already have two apps on heroku
- You have the two remotes linked to your rails app
The first step is to copy the config/environments/production.rb
file into config/environments/staging.rb
, notice this last file is not created by default, you would have to create it.
Rails by default will pick up the staging.rb
file as an alternative environment so you can use it on your Gemfile
for example.
You can basically follow this guide which will tell you how to setup a production environment. Go ahead, but come back.
Once you have completed reading that last article you just need one step to tell Heroku how to run on staging environment:
$ heroku config:set RAILS_ENV=staging --remote staging
$ heroku config:set RACK_ENV=staging --remote staging
Restart the application:
$ heroku restart app --remote staging
You are good to go!