# from app root run
rails r "puts Rails.env"
ENV['foo']
# nil
ENV.fetch('foo')
# Raises KeyError (key not found: "foo")
ENV.fetch('foo', :default_need_not_be_a_string)
# => :default_need_not_be_a_string
ENV['foo'] = '123'
ENV['foo']
# => '123'
ENV.fetch('foo')
# => '123'
ENV.fetch('foo', :default_need_not_be_a_string)
# => '123'