Ruby on rails SSL_connect返回=1 errno=0 state=SSLv2/v3读取服务器hello A:rails 4中的未知协议错误
我正在为我的应用程序实施Desive mailers,我已完成以下步骤: 在模型中:Ruby on rails SSL_connect返回=1 errno=0 state=SSLv2/v3读取服务器hello A:rails 4中的未知协议错误,ruby-on-rails,devise,Ruby On Rails,Devise,我正在为我的应用程序实施Desive mailers,我已完成以下步骤: 在模型中: class User < ActiveRecord::Base # Include default devise modules. Others available are: # :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :confirmable,
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :trackable, :validatable
end
在development.rb中:
config.assets.raise_runtime_errors = true
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:enable_starttls_auto => true,
:address => 'smtp.gmail.com',
:port => 587,
:tls => 'true',
:domain => 'gmail.com',
:authentication => :plain,
:user_name => 'example@gmail.com',
:password => '326272814example'
}
当我单击“忘记密码”时,我得到的错误为:
OpenSSL::SSL::SSLError在designe::passwords控制器中#create
SSL\u connect返回=1 errno=0 state=SSLv2/v3读取服务器hello A:未知协议
通过一些链接,我补充道:
config.mailer_sender = 'example@gmail.com'
:enable_starttls_auto => false,
:openssl_verify_mode => 'none'
到development.rb,但没有帮到我。请帮帮我吧我想你的一些smtp\u设置对于gmail来说是不正确的。试一试
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'example.com',
user_name: '<username>',
password: '<password>',
authentication: 'plain',
enable_starttls_auto: true }
config.action\u mailer.smtp\u设置={
地址:'smtp.gmail.com',
港口:587,
域:“example.com”,
用户名:“”,
密码:“”,
身份验证:“普通”,
启用\u starttls\u auto:true}
(From)我收到错误
534-5.7.14 From:尝试在您的gmail帐户中启用“访问不太安全的应用程序”。为应用程序创建特定的密码,这是一种更安全的方法。在此处了解如何执行此操作: