延迟作业Rails 3未定义方法'up'

时间:2011-10-06 18:28:03

标签: ruby-on-rails-3 activerecord delayed-job background-process

我正在尝试使用Rails 3.0.7从几个月前复活一个项目。

我以前推迟了工作,但是现在我已经更新了我的宝石,当我尝试enqueue时,我得到以下错误。

NoMethodError (undefined method up'for:null:Symbol):`

代码行是:

Delayed::Job.enqueue DelayedXlsExport.new(@email, timestamp, filename)

DelayedXlsExport是:

class DelayedXlsExport < Struct.new(:email, :timestamp, :filename)  
  def perform
    ....
  end
end

这是堆栈的一部分:

  

activesupport(3.0.10)lib / active_support / callbacks.rb:415:in   _run_create_callbacks' activerecord (3.0.10) lib/active_record/callbacks.rb:277:in创建'activerecord(3.0.10)   lib / active_record / persistence.rb:257:在create_or_update' activerecord (3.0.10) lib/active_record/callbacks.rb:273:in块中   create_or_update'activesupport(3.0.10)   lib / active_support / callbacks.rb:419:in _run_save_callbacks' activerecord (3.0.10) lib/active_record/callbacks.rb:273:in create_or_update'activerecord(3.0.10)   lib / active_record / persistence.rb:40:in save' activerecord (3.0.10) lib/active_record/validations.rb:43:in save'activerecord(3.0.10)   lib / active_record / attribute_methods / dirty.rb:21:在save' activerecord (3.0.10) lib/active_record/transactions.rb:240:in块(2级)中   保存'activerecord(3.0.10)lib / active_record / transactions.rb:292:in   block in with_transaction_returning_status' activerecord (3.0.10) lib/active_record/connection_adapters/abstract/database_statements.rb:139:in 交易'activerecord(3.0.10)   lib / active_record / transactions.rb:207:in transaction' activerecord (3.0.10) lib/active_record/transactions.rb:290:in with_transaction_returning_status'activerecord(3.0.10)   lib / active_record / transactions.rb:240:in block in save' activerecord (3.0.10) lib/active_record/transactions.rb:251:in rollback_active_record_state!' activerecord(3.0.10)   lib / active_record / transactions.rb:239:in save' activerecord (3.0.10) lib/active_record/base.rb:504:in create'   C:/dev/Ruby/Ruby192/lib/ruby/gems/1.9.1/bundler/gems/delayed_job-8efc2aa99e8b/lib/delayed/backend/base.rb:28:在   `入队'

我的宝石文件:

gem "delayed_job", :branch => 'v2.1', :git => 'git://github.com/collectiveidea/delayed_job.git'

这里有什么想法吗?

1 个答案:

答案 0 :(得分:0)

更新无用的宝石解决了这个问题

gem 'workless', '0.2.0'