延迟作业 Rails 3 未定义方法“up”
我正在尝试使用 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:increate_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:in
create_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:intransaction' 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保存'activerecord中的块 (3.0.10)lib/active_record/transactions.rb:251:in
rollback_active_record_state!'活动记录 (3.0.10) lib/active_record/transactions.rb:239:insave' 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 method
up' 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)
create' activerecord (3.0.10)
lib/active_record/callbacks.rb:277:in
lib/active_record/persistence.rb:257:increate_or_update'
block in
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'
create_or_update' activerecord (3.0.10)
activerecord (3.0.10) lib/active_record/callbacks.rb:273:in
lib/active_record/persistence.rb:40:insave' activerecord (3.0.10)
save' activerecord (3.0.10)
lib/active_record/validations.rb:43:in
lib/active_record/attribute_methods/dirty.rb:21:insave' activerecord
block (2 levels) in
(3.0.10) lib/active_record/transactions.rb:240:in
save' activerecord (3.0.10) lib/active_record/transactions.rb:292:inblock in with_transaction_returning_status' activerecord (3.0.10)
transaction' activerecord (3.0.10)
lib/active_record/connection_adapters/abstract/database_statements.rb:139:in
lib/active_record/transactions.rb:207:intransaction' activerecord
with_transaction_returning_status' activerecord (3.0.10)
(3.0.10) lib/active_record/transactions.rb:290:in
lib/active_record/transactions.rb:240:inblock in save' activerecord
rollback_active_record_state!' activerecord (3.0.10)
(3.0.10) lib/active_record/transactions.rb:251:in
lib/active_record/transactions.rb:239:insave' activerecord (3.0.10)
create'
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
`enqueue'
My gem file:
gem "delayed_job", :branch => 'v2.1', :git => 'git://github.com/collectiveidea/delayed_job.git'
Any ideas here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新 workless gem 修复了此问题
gem 'workless', '0.2.0'
Updating the workless gem fixed this issue
gem 'workless', '0.2.0'