【发布时间】:2011-05-24 01:16:03
【问题描述】:
我在这里使用delayed_job gem:https://github.com/collectiveidea/delayed_job
我在观察者中有以下内容:
UserMailer.delay.msg_notification(record)
在 user_mailer.rb 中
class UserMailer < ActionMailer::Base
...
def msg_notification(record)
mail(
:to => "#{record.user.email}",
:subject => "Notification"
)
end
..
end
但是这个错误:
NoMethodError (undefined method `delay' for UserMailer:Class):
有什么想法吗?谢谢
【问题讨论】:
-
您是否仔细检查过 gem 是否在您的 gem 文件中,并且您已经运行了 bundle install。您是否还按照文档中的说明创建了 gem 所需的后端表?
标签: ruby-on-rails ruby-on-rails-3 delayed-job