我无法让排队的delayed_jobs在我的已验证的heroku帐户上运行。这是细分:
当我在heroku上调用delayed_job时
# tropo_controller.rb in app/controllers
class TropoController < ApplicationController
require 'lib/event_job'
...
def sms
Delayed::Job.enqueue(EventJob.new(nil))
然后验证delayed_job是否存在
$ heroku console
>> Delayed::Job.all
[#<Delayed::Backend::ActiveRecord::Job id: 2, priority: 0, attempts: 0, handler: "--- !ruby/struct:EventJob \nevent_id: \n", last_error: nil, run_at: "2011-05-30 21:01:24", locked_at: nil, failed_at: nil, locked_by: nil, created_at: "2011-05-30 21:01:24", updated_at: "2011-05-30 21:01:24">]
并尝试以这种方式开始新员工
$ heroku rake jobs:work
Starting job worker
(hangs)
或者这样
$ heroku workers 1
/Users/jaimeohm/.rvm/gems/ruby-1.9.2-p0@rails303/gems/heroku-2.2.1/lib/heroku/command.rb:125:in `rescue in run': undefined local variable or method `args' for Heroku::Command:Module (NameError)
from /Users/jaimeohm/.rvm/gems/ruby-1.9.2-p0@rails303/gems/heroku-2.2.1/lib/heroku/command.rb:116:in `run'
from /Users/jaimeohm/.rvm/gems/ruby-1.9.2-p0@rails303/gems/heroku-2.2.1/bin/heroku:14:in `<top (required)>'
from /Users/jaimeohm/.rvm/gems/ruby-1.9.2-p0@rails303/bin/heroku:19:in `load'
from /Users/jaimeohm/.rvm/gems/ruby-1.9.2-p0@rails303/bin/heroku:19:in `<main>'
失败了。我运行gem update heroku
,重置数据库,然后重新启动服务器,它仍然失败。我故意清空排队作业的执行方法
# event_job.rb in app/lib
class EventJob < Struct.new(:event_id)
def perform
# empty for now
end
end
我错过了什么?
答案 0 :(得分:1)
Heroku现已修复了这个错误,截至heroku gem的v2.2.2。