0
我也遵循了每當教程和安裝的寶石。我正在使用Ubuntu。我在模型編寫這個方法:在schedule.rb每當寶石不能正常工作軌道4
def self.cron_job
puts "am in cron"
InspectionReport.all
logger.info Time.now.to_s
InspectionReport.all.each do |ins|
ins.date = ins.date+1.month
ins.save!
end
end
代碼:一分鐘後
set :output, "/log/cron.log"
every 1.minute do
runner "InspectionReport.cron_job", :environment => :development
rake update_inspection_reports end
什麼也沒有發生。有任何想法嗎?