Rails.env
only gives you the value of ENV["RAILS_ENV"]
or ENV["RACK_ENV"]
. If none of them were set, it returns "development"
.
The ENV
object is provided by Ruby.
For another way to access it, you might consider either implementing it by yourself, or using the figaro gem. Set environment variables in a YAML config. Then they can be accessed like this:
Figaro.env.rails_relative_url_root