2016-04-11 43 views
3

我有Rails應用程序,它使用設計ofr身份驗證和sidekiq作爲後臺電子郵件作業。突然,在發展而已,我正在與嘗試相關聯下面的錯誤,從應用程序發送電子郵件(如制定忘記密碼)Rails 4:EOFError:文件結尾在開發任何電子郵件後到達

 EOFError: end of file reached 

奇怪的是在生產工程中的應用(Heroku的設置使用sendgrid)。我沒有改變我的任何開發電子郵件設置....

ActionMailer::Base.default :from => '[email protected]' 

    config.action_mailer.delivery_method = :smtp 
    config.action_mailer.perform_deliveries = true 
    config.action_mailer.raise_delivery_errors = true 
    config.action_mailer.smtp_settings = { 
     :address => "smtp.gmail.com", 
     :port => 587, 
     :domain => '@gmail.com', 
     :user_name => "[email protected]", 
     :password => "xxxxxxxx", 
     :authentication => 'plain', 
     :enable_starttls_auto => true 
    } 

    config.action_mailer.default_url_options = { :host => 'localhost:3000' } 

我找不到任何解決這個網上。另外我注意到,所有使用類似設置的應用程序在開發中都會拋出相同的錯誤。我嘗試了一個不同的電子郵件地址和密碼(再次gmail),沒有運氣....

回答

1

對於那些誰卡住....這工作,但我不明白爲什麼。

config.action_mailer.raise_delivery_errors = true 

config.action_mailer.delivery_method = :smtp 

config.action_mailer.smtp_settings = { 
    address: "smtp.gmail.com", 
    port: 587, 
    domain: "myprojectdomain.com", 
    user_name: "[email protected]", 
    password: "xxxx", 
    authentication: 'plain', 
    enable_starttls_auto: true 
} 

config.action_mailer.default_url_options = { :host => 'localhost:3000' } 
+3

你在設置中改變了什麼? – Aleksey

1

對於那些喜歡Aleksey想知道的問題是如何解決的,他增加了一個有效的域。從domain: '@gmail.com'domain: "myprojectdomain.com"

1

對我來說,在我的Devise配置文件中設置發件人電子郵件解決了問題。

相關問題