method

environment

environment()
public

Return the currently selected environment. By default, it returns the value of the RAILS_ENV constant.

1Note

Custom environment constants

james ยท Jul 24, 20081 thank

Custom environment level constants can be passed in to your rails application (server, console, whatever) like this):

bash, tcsh, whatever shell

GAMEMODE=pregame script/server

Within rails this constant can be accessed by

ENV['GAMEMODE'] => "pregame"

ENV['DOES-NOT-EXIST'] => nil