保存设备用户时出现 Rails EOFError(到达文件末尾) [英] Rails EOFError (end of file reached) when saving a devise user

查看:59
本文介绍了保存设备用户时出现 Rails EOFError(到达文件末尾)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试创建用户时在生产中遇到此错误(我正在使用设计 gem).

I'm getting this error in production when trying to create a user (i'm using the devise gem).

EOFError (end of file reached):

我之前遇到过这个问题,这是由于我使用 zoho 邮件的 smtp 设置造成的.

I hit this problem before and it was due to my smtp settings using zoho mail.

我相信我的以下配置可以解决问题:

I believe my configuration below is what fixed the problem:

ActionMailer::Base.delivery_method = :smtp  
ActionMailer::Base.smtp_settings = {            
  :address              => "smtp.zoho.com", 
  :port                 => 465,              
  :domain               => 'example.com',   
  :user_name            => 'user@example.com',
  :password             => 'password',         
  :authentication       => :login,
  :ssl                  => true,
  :tls                  => true,
  :enable_starttls_auto => true    
}

现在我们已经向站点添加了 SSL,我相信这就是导致现在发生此错误的原因.

Now we've added SSL to the site and I believe that is what is causing this error to occur now.

是否有人对此错误或使用 SSL 的 zoho 邮件 smtp 设置有任何见解?

Does anyone have any insight into this error or zoho mail smtp settings with SSL?

推荐答案

这个错误是因为我的 config/initializers/devise.rb 没有为 config.mailer_sender 指定正确的电子邮件地址.

This error was caused by not having my config/initializers/devise.rb specifying the correct email address for config.mailer_sender.

这篇关于保存设备用户时出现 Rails EOFError(到达文件末尾)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆