Update Rails environment call

Switch from ENV['RAILS_ENV'] to Rails.env