当用户注册时,激活电子邮件可以正常工作。但是,尝试登录和重新发送激活电子邮件会导致以下生产日志:
Started POST "/u/action/send_activation_email" for (removed ip and timestamp)
Processing by UsersController#send_activation_email as */*
Completed 404 Not Found in 2ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 542)
此错误发生在运行 3.2.0.beta1-dev 的所有容器上。“production_errors.log”为空。
重现步骤:
- 使用默认表单注册
- 忽略激活电子邮件并尝试登录
- 在弹出窗口“您还不能登录。我们之前已向您发送了一封激活电子邮件…”中,点击“重新发送激活电子邮件”
- “发生错误:找不到请求的 URL 或资源。”
- 点击“确定”,然后出现以下弹出窗口“我们已向您发送了另一封激活电子邮件至…”(然而第二封激活电子邮件实际上并未发送)
我看到函数/操作 send_activation_email 已被速率限制。
def send_activation_email
if current_user.blank? || !current_user.staff?
RateLimiter.new(nil, "activate-hr-#{request.remote_ip}", 30, 1.hour).performed!
RateLimiter.new(nil, "activate-min-#{request.remote_ip}", 6, 1.minute).performed!
end
这会导致 404 错误吗?还有其他日志可以查看以调试此问题吗?

