延迟的作业给出了未定义的方法错误 [英] Delayed Job giving a undefined method error

查看:87
本文介绍了延迟的作业给出了未定义的方法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

延迟的作业(2.1.4)在我的开发计算机上运行正常,放弃了同志发送电子邮件-但是,在使用Apache / Passenger(3.0.7)在我的服务器上运行时,它却失败了。

我已经看到在使用Thin创建作业的情况下存在问题:

  ---!ruby / struct:Delayed :: PerformableMailer 
对象:!ruby / object:Class UserMailer

何时应显示为:

  ---!ruby / struct:Delayed :: PerformableMailer 
对象:!ruby / class UserMailer

我的开发机器上的矿井是正确创建的,但是在服务器上创建矿井的方式却是错误的。



其他任何人都有这个问题,我应该在哪里?开始寻找?



Stacktrace:

  {未定义方法 standard_message对于#< Class:0xc6ad054> 
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/performable_mailer.rb:6:in`perform'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/backend/base.rb:87:inʻinvoke_job'\n
/ home /safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:120:在`block(2 level)in run'\n
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/timeout.rb:57:in`timeout'\n
/ home / safrea / site / shared /bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:120:in`run in block'\n
/ usr / local / rvm / rubies / ruby -1.9.2-p180 / lib / ruby​​ / 1.9.1 / benchmark.rb:309:在`realtime'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems中/delayed_job-2.1.4/lib/delayed/worker.rb:119:在`run'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1中.4 / lib / delayed / worker.rb:177:in`reserve_and_run_one_job'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib /delayed/worker.r b:104:在`work_off'\n中
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb中: 103:在`times'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:103:in` work_off'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:78:in`block(2个级别)in start'\n
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/benchmark.rb:309:in`realtime'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:77:in`block in start'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:74:在`loop'\n
/ home / safrea / site / shared / bundle / ruby​​ / 1.9.1 / gems / delayed_job-2.1.4 / lib / delayed / worker.rb:74:在`start'\n
/ home / safrea / site / shared / bundle / ruby​​ / 1.9.1 / gems / delayed_job-2.1.4 / lib / delayed / command.rb:104:在`run'\n
/ home / safrea / site / shared / bundle /红宝石/1.9.1/宝石/delayed_job-2.1.4/li b / delayed / command.rb:83:在`run_process'中的块'n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/ daemons / application.rb:249:在`call'n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/application中。 rb:249:在start_proc中的块
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/daemonize.rb: 199:in`call'n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/daemonize.rb:199:in` call_as_daemon'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/application.rb:253:在`start_proc'\中n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/application.rb:293:在`start'中$ n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/controller.rb:70:在`run'\n
/ home / safrea / site / shared / bundle / ruby​​ / 1.9.1 / gems / daemons-1.1.3 / lib / daemons.rb:195:在`run_proc'\n中的块
/ home / safrea / site /共享/小礼物dle / ruby​​ / 1.9.1 / gems / daemons-1.1.3 / lib / daemons / cmdline.rb:109:in`call'n
/ home / safrea / site / shared / bundle / ruby​​ / 1.9.1 / gems / daemons-1.1.3 / lib / daemons / cmdline.rb:109:在`catch_exceptions'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/中gems / daemons-1.1.3 / lib / daemons.rb:194:在`run_proc'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1。 4 / lib / delayed / command.rb:81:在`run_process'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/ delay / command.rb:75:in`block in daemonize'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/ command.rb:73:在$ times中
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/command.rb: 73:in`daemonize'\n
script / delayed_job:5:in`< main>'


解决方案

我设法解决了这个问题。



几周前捆绑器停止时,我创建了setup_load_paths.rb。为某人工作易事。这意味着gemfile会被加载到任何地方,除了乘客。这弄乱了对YAML :: ENGINE.yamler = syck的调用,这似乎是使对象保存失败的原因。



我删除了setup_load_paths和所有内容现在运行良好。


Delayed job (2.1.4) is working perfectly on my development machine, sending emails with gay abandon - however it is failing miserably when running on my server using Apache/Passenger(3.0.7). Rails 3.0.7 and ruby 1.9.2 on both btw.

I have seen that there is a problem when using thin where the job is created like this:

--- !ruby/struct:Delayed::PerformableMailer
object: !ruby/object:Class UserMailer

when it should read:

--- !ruby/struct:Delayed::PerformableMailer
object: !ruby/class UserMailer 

Mine are created correctly on my development machine, but the wrong way when created on the server.

Has anyone else had this problem, where should I start looking?

Stacktrace:

{undefined method `standard_message' for #<Class:0xc6ad054>
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/performable_mailer.rb:6:in `perform'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/backend/base.rb:87:in `invoke_job'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:120:in `block (2 levels) in run'\n
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/timeout.rb:57:in `timeout'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:120:in `block in run'\n
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:119:in `run'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:177:in `reserve_and_run_one_job'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:104:in `block in work_off'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:103:in `times'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:103:in `work_off'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:78:in `block (2 levels) in start'\n
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:77:in `block in start'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:74:in `loop'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/worker.rb:74:in `start'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/command.rb:104:in `run'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/command.rb:83:in `block in run_process'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/application.rb:249:in `call'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/application.rb:249:in `block in start_proc'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/daemonize.rb:199:in `call'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/daemonize.rb:199:in `call_as_daemon'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/application.rb:253:in `start_proc'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/application.rb:293:in `start'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/controller.rb:70:in `run'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons.rb:195:in `block in run_proc'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/cmdline.rb:109:in `call'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons/cmdline.rb:109:in `catch_exceptions'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/daemons-1.1.3/lib/daemons.rb:194:in `run_proc'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/command.rb:81:in `run_process'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/command.rb:75:in `block in daemonize'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/command.rb:73:in `times'\n
/home/safrea/site/shared/bundle/ruby/1.9.1/gems/delayed_job-2.1.4/lib/delayed/command.rb:73:in `daemonize'\n
script/delayed_job:5:in `<main>'

解决方案

I have managed to fix this.

I created a setup_load_paths.rb a few weeks ago when bundler stopped working for some reason. This meant that the gemfile was being loaded everywhere, except by passenger. This messed up the call to YAML::ENGINE.yamler = "syck" which seems to be what mucked up the saving of the object.

I removed the setup_load_paths and everything is working nicely now.

这篇关于延迟的作业给出了未定义的方法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆