Fixed RAILS_ENV and use File.join instead of Rails.root.join