I\'m trying to create a new environment (build) for using it with hudson.
I\'m doing this because I didn\'t want to mix up my test databases with hudson test databas
Updated Answer for Rails 5
Create new environment file:
config/environments/staging.rb
Modify the following files to add the environment key 'staging'
config/cable.yml
config/database.yml
config/secrets.yml
Gemfile (incase you have stage dependent gems)
The new environments can now be used as usual for eg:
rails server -e staging
rails console staging
Or to do conditional checks:
rails console staging, Rails.env.staging?
Good place to start for creating new environment and to modify these files is to copy production settings.