【问题标题】:UserMailer failing in Delayed::JobUserMailer 在 Delayed::Job 中失败
【发布时间】:2016-09-06 02:33:08
【问题描述】:

我正在尝试在 Rails 5 中发送一封带有 Delayed::Job 的电子邮件,如下所示:UserMailer.delay.test("my message", "email@example.com")。不幸的是,它不起作用。它给出了这个错误:

FAILED (0 prior attempts) with ArgumentError: unknown command 'h'

或者,有时,

FAILED (0 prior attempts) with NoMethodError: undefined methoddeliver' for false:FalseClass`

堆栈跟踪非常神秘。

我可以通过在任何方法后附加handle_asynchronously :some_method 来异步运行其他方法。

UserMailer.test("my message", "email@example.com").deliver_now 工作正常。我该如何调试这个问题?我的语法错了吗?

【问题讨论】:

    标签: ruby-on-rails actionmailer delayed-job


    【解决方案1】:

    这是因为我的 UserMailer 方法被命名为 test,这在 Delayed::Job 中似乎不起作用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-03
      • 1970-01-01
      • 1970-01-01
      • 2021-07-26
      • 1970-01-01
      • 1970-01-01
      • 2011-10-02
      • 2023-03-09
      相关资源
      最近更新 更多