I\'m trying to get delayed job to work as a rake task, but for the life of me I can\'t figure out what I\'m doing wrong. Given the following setup:
#config/envi
DelayedJob defines handle_asynchronously
in Delayed::MessageSending::ClassMethods
. DelayedJob automatically monkey-patches that module into Module
in its lib/delayed_job.rb
. You'll likely have better luck requiring that in your Rake task:
#Rakefile
begin
require 'delayed_job'
require 'delayed/tasks'
rescue LoadError
STDERR.puts "Run `rake gems:install` to install delayed_job"
end