Job delay giving an undefined method error

The deferred task (2.1.4) works fine on my development machine, sending emails with gay rejection - however, when it starts on my server with Apache / Passenger (3.0.7) it fails. Rails 3.0.7 and ruby ​​1.9.2 on both devices.

I saw that there is a problem when using thin, where the task is created as follows:

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

when he should read:

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

Mines are created correctly on my development machine, but not when they are created on the server.

Has anyone else had this problem, where do 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>' 
+6
source share
2 answers

I managed to fix it.

I created setup_load_paths.rb a few weeks ago when the provider somehow stopped working. This meant that the gemfile loaded everywhere except for the passenger. This confused the call to YAML :: ENGINE.yamler = "syck", which seems to have started saving the object.

I removed setup_load_paths and now everything works beautifully.

+4
source

If using the Syck parser doesn't work (as mentioned in Marc's answer), try using a parser instead.

 YAML::ENGINE.yamler = "psych" 
0
source

Source: https://habr.com/ru/post/890204/


All Articles