【发布时间】:2013-09-06 05:41:15
【问题描述】:
我正在创建一个允许用户介绍其他两个用户的网站。然后通过电子邮件通知用户已为他们创建了匹配的消息。
在本地使用延迟作业可以正常工作,但在部署到 heroku 时出现奇怪的错误:
String#notify_new_match 因 NoMethodError 失败:未定义方法 `notify_new_match' for "UserMailer":String
这是控制器代码:
UserMailer.delay.notify_new_match(current_user, match_email, params[:note])
还有邮件代码:
class UserMailer < ActionMailer::Base
def notify_new_match(user, email, message)
@message = message
mail(:to => email,
:subject => "#{user.first_name} wants to introduce you")
end
end
相关的宝石:
gem 'rails', "~> 3.2.0"
gem 'delayed_job_active_record'
gem 'activerecord-import'
gem 'thin'
gem 'pg'
【问题讨论】: