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

发布于 2024-12-08 16:34:51 字数 2343 浏览 1 评论 0原文

我正在尝试使用 Rails 3.0.7 恢复几个月前的项目。

我之前曾延迟处理它,但现在我更新了我的 gems,当我尝试enqueue某些东西时,我收到以下错误。

NoMethodError(未定义方法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:in 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:在 _run_save_callbacks' activerecord (3.0.10) lib/active_record/callbacks.rb:273:increate_or_update'activerecord (3.0.10) lib/active_record/persistence.rb:40:在 save' activerecord (3.0.10) lib/active_record/validations.rb:43:in保存'activerecord (3.0.10) lib/active_record/attribute_methods/dirty.rb:21:在中保存'activerecord (3.0.10) lib/active_record/transactions.rb:240:in块(2 级)中 保存’activerecord (3.0.10) lib/active_record/transactions.rb:292: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:inwith_transaction_returning_status' activerecord (3.0.10) lib/active_record/transactions.rb:240:in 保存'activerecord中的块 (3.0.10)lib/active_record/transactions.rb:251:inrollback_active_record_state!'活动记录 (3.0.10) lib/active_record/transactions.rb:239:in save' activerecord (3.0.10) lib/active_record/base.rb:504:in创建' C:/dev/Ruby/Ruby192/lib/ruby/gems/1.9.1/bundler/gems/delayed_job-8efc2aa99e8b/lib/delayed/backend/base.rb:28:in `入队'

我的 gem 文件:

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

这里有什么想法吗?

I'm trying to resurrect a project from a few months ago using Rails 3.0.7.

I had delayed job working on it previously, but now Ive updated my gems I get the following error when I try and enqueue something.

NoMethodError (undefined methodup' for :null:Symbol):`

The line of code is:

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

DelayedXlsExport is:

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

And here is part of the stack:

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
create' activerecord (3.0.10)
lib/active_record/persistence.rb:257:in create_or_update'
activerecord (3.0.10) lib/active_record/callbacks.rb:273:in
block 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:in save' activerecord
(3.0.10) lib/active_record/transactions.rb:240:in
block (2 levels) in
save' 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
transaction' 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:in
`enqueue'

My gem file:

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

Any ideas here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沐歌 2024-12-15 16:34:52

更新 workless gem 修复了此问题

gem 'workless', '0.2.0'

Updating the workless gem fixed this issue

gem 'workless', '0.2.0'

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文