我正在尝试在 rails 4 应用程序中使用 devise gem 设置 MailyHerald。我按照以下步骤操作: https ://github.com/Sology/maily_herald/wiki/Setup-with-'devise'-gem
现在,当我尝试注册新用户(应通过 MailyHerald 发送确认邮件)时,我收到此错误:
NoMethodError at /user
undefined method `[]' for false:FalseClass
maily_herald (0.9.3) lib/maily_herald.rb
# Gets the Maily logger.
def logger
unless MailyHerald::Logging.initialized?
opts = {
level: options[:verbose] ? Logger::DEBUG : Logger::INFO,
}
opts[:target] = options[:logfile] if options[:logfile]
MailyHerald::Logging.initialize(opts)
end
任何想法?谢谢
编辑:一个小更新,可能与我得到的错误有关:
当我做
maily_herald paperboy --start
如上页所示,我得到
undefined method `merge' for false:FalseClass
编辑2: 好的,我做了一些测试。
我从头开始创建了一个新的应用程序(rails 4.2.5.1 和 ruby 2.2.4p230)。现在,当用户注册时我没有收到任何错误,但没有发送确认电子邮件。
运行后台处理
maily_herald paperboy --start
返回这个
[Maily#cli] INFO: Started with options: {:mode=>:paperboy, :action=>:start, :daemon=>true}
You really should set a logfile if you're going to daemonize
/Users/fabbrro/.rvm/gems/ruby-2.2.4@testMailyHerald/gems/maily_herald-0.9.3/lib/maily_herald/cli.rb:200:in `daemonize'
/Users/fabbrro/.rvm/gems/ruby-2.2.4@testMailyHerald/gems/maily_herald-0.9.3/lib/maily_herald/cli.rb:45:in `paperboy'
/Users/fabbrro/.rvm/gems/ruby-2.2.4@testMailyHerald/gems/maily_herald-0.9.3/bin/maily_herald:10:in `<top (required)>'
/Users/fabbrro/.rvm/gems/ruby-2.2.4@testMailyHerald/bin/maily_herald:23:in `load'
/Users/fabbrro/.rvm/gems/ruby-2.2.4@testMailyHerald/bin/maily_herald:23:in `<main>'
/Users/fabbrro/.rvm/gems/ruby-2.2.4@testMailyHerald/bin/ruby_executable_hooks:15:in `eval'
/Users/fabbrro/.rvm/gems/ruby-2.2.4@testMailyHerald/bin/ruby_executable_hooks:15:in `<main>’
为了进一步调查,我还尝试设置示例应用程序。我创建了一些实体(用户)并尝试向他们发送电子邮件(通过 mailcatcher)。直到现在,即使没有安装devise gem,似乎我也没有运气:运行后台处理时根本没有消息,没有错误,也没有发送邮件。有人成功尝试了该应用程序吗?