Updated Answer for Rails 5
Create a new environment file:
config/environments/staging.rb
Modify the following files to add the 'staging' environment key
config/cable.yml config/database.yml config/secrets.yml Gemfile (incase you have stage dependent gems)
New environments can now be used as usual, for example, for:
rails server -e staging
rails console staging
Or do conditional checks:
rails console staging, Rails.env.staging?
A good place to start creating a new environment and modify these files is to copy production parameters.
Shaunak Dec 22 '16 at 5:13 2016-12-22 05:13
source share