Return the currently selected environment. By default, it returns the value of the RAILS_ENV constant.
# File railties/lib/initializer.rb, line 522 def environment ::RAILS_ENV end
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