开发者

Heroku + DelayedJob failing at 'rake jobs:work' and 'heroku workers 1'

I cannot get queued delayed_jobs to run on my verified her开发者_Go百科oku account. Here is the breakdown:

When I invoke delayed_job on heroku

# tropo_controller.rb in app/controllers
class TropoController < ApplicationController
  require 'lib/event_job'

  ...

  def sms
    Delayed::Job.enqueue(EventJob.new(nil))

And then verify that the delayed_job exists

$ 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">]

And attempt to start a new worker either this way

$ heroku rake jobs:work
Starting job worker

(hangs)

or this way

$ 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>'

It fails. I run gem update heroku, reset the DB, and restart the server, and it still fails. I deliberately empty the perform method of the queued job

# event_job.rb in app/lib
class EventJob < Struct.new(:event_id)
  def perform
    # empty for now
  end
end

What am I missing?


Heroku has now fixed this bug as of v2.2.2 of the heroku gem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜