Undefined Method Error When Creating Delayed_Job Workers with Script/Delay_Job

Undefined Method Error when creating delayed_job workers with script/delay_job

It looks like the problem was derived from bundler >= 1.0.10 loading up psych and overwriting some of sycks functionality if libyaml is present. I was able to remove the libyaml install from my system, something that I know won't be possible for everyone. Tough to track down, hopefully this post will help someone else

Delayed_job: Undefined method error on any call

I was Googling the same issue, and I found a fix for this(it worked for me).

add these two lines to the head of your config/application.rb

require 'yaml'

YAML::ENGINE.yamler = 'syck'

then, restart your server(webrick/thin/whatever) and delayed_job
(bundle exec ./script/delayed_job restart)

done.

undefined method error when running delayed_jobs in multiple queues with ./script/delayed_job -n

well, try

bundle exec ./script/delayed_job -n 2 start

;)

Delayed Job giving a undefined method error

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.

Delayed Job failing in Production environment on Server

I figured it out. It was due to package "libyaml" package, which was not present on my local system but was installed on server.

Delayed_job: undefined method `handle_asynchronously' for #Class:0x4601b08

I had a model called DelayedJob in my models directory. I added this model to query the job queue. This conflicted with the delayed_job.rb file. I renamed the file and the problem went away.

Rails 4 Delayed_job error - Job failed to load: undefined class/module CustomJob

I always feel like the answer is obvious...AFTER I figure it out.

The problem was that I was using a shared database and there were existing workers accessing this DB. Though I was restarting and refreshing my local instance of the server, the other instances were trying to run my jobs and the OTHER workers were causing the error, not my local instance.

Solution: Ensure that other instances of delayed_job are using the same table as the code you're testing/building/using. If so, use another DB if possible.



Related Topics



Leave a reply



Submit