gem delayed_jobs在开发环境中完美运行。但在生产中,它不起作用。它会在日志中引发以下错误
使用此delayed_job向用户发送电子邮件
I, [2013-11-20T13:55:28.418252 #31220] INFO -- : 2013-11-20T13:55:28+0000:
[Worker(delayed_job host:li483-234 pid:31220)] 1 jobs processed at 77.3979 j/s, 1 failed
I, [2013-11-20T14:05:48.680718 #31220] INFO -- : 2013-11-20T14:05:48+0000: [Worker(delayed_job host:li483-234 pid:31220)] Job Class#receive_msg (id=1) RUNNING
E, [2013-11-20T14:05:48.683409 #31220] ERROR -- : 2013-11-20T14:05:48+0000: [Worker(delayed_job host:li483-234 pid:31220)] Job Class#receive_msg (id=1) FAILED (5 prior attempts) with NoMethodError: undefined method `email' for nil:NilClass
任何线索?
答案 0 :(得分:0)
我找到了答案
在config/application.rb
中将其置于顶部
require 'yaml'
YAML :: ENGINE.yamler ='psych'
重启服务器和RAILS_ENV =生产箱/ delayed_job启动