Rake task failing to load :environment properly
问题 I'm running a custom rake task... namespace :import do desc "Import terms of service as HTML from stdin" task :terms => :environment do html = STDIN.read settings = ApplicationWideSetting.first settings.terms_and_conditions = html if settings.save puts "Updated terms of service" else puts "There was an error updating terms of service" end end end The model ApplicationWideSetting is reported as undefined when running the task in the production environment. However, when running the task on