我以前没有经历过这种情况,但是自从将我的 rails 站点移动到 Heroku 后,每当尝试触发 Devise 发送电子邮件时,我都会收到以下消息
Started POST "/members/forgot-password" for 127.0.0.1 at 2013-02-24 00:02:27 +1100
Processing by Devise::PasswordsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"9G1P34ddbq2TN7SkmFuCet5d7fPMvWdSSpIaGqSZW9g=", "user"=>{"email"=>"paul.mcguane@*****"}, "commit"=>"Recover password"}
User Load (3.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'paul.mcguane@me.com' LIMIT 1
Completed 500 Internal Server Error in 31ms
ArgumentError - wrong number of arguments (2 for 1):
app/mailers/devise/mailer.rb:8:in `reset_password_instructions'
邮件程序.rb
class Devise::Mailer < ::ActionMailer::Base
include Devise::Mailers::Helpers
def confirmation_instructions(record)
devise_mail(record, :confirmation_instructions)
end
def reset_password_instructions(record)
devise_mail(record, :reset_password_instructions)
end
def unlock_instructions(record)
devise_mail(record, :unlock_instructions)
end
end