3

我正在尝试在 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,似乎我也没有运气:运行后台处理时根本没有消息,没有错误,也没有发送邮件。有人成功尝试了该应用程序吗?

4

1 回答 1

2

我刚刚注意到这个问题。你看过我在 github 上的评论吗?

https://github.com/Sology/maily_herald/issues/17#issuecomment-182412069

另外,我检查了我的Procfile并且正在运行:

web: bundle exec rails s
worker: bundle exec sidekiq -v
paperboy: bundle exec maily_herald paperboy

Sidekiq是必不可少的MailyHerald。我认为它没有在 Wiki 页面上指定。让我知道这是否能解决您的问题。我也会尝试使用您的设置设置新的应用程序。我可以查看任何公共回购吗?

更新

刚刚创建了新的应用程序:

然后在浏览器中打开 mailcatcher 和应用程序并注册新用户。您应该会看到新添加的邮件发送到运行它的调度程序和 sidekiq 日志中。

于 2016-02-23T15:37:53.120 回答