【发布时间】:2015-06-13 18:45:05
【问题描述】:
我正在为我的应用程序实施设计邮件,我已完成以下步骤:
在模型中:
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
然后我添加了confirmation_token、confirmed_at、 Confirmation_sent_at
在 devise.rb 中,我添加了:
config.mailer_sender = 'example@gmail.com'
在 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 in Devise::PasswordsController#create
SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol
通过一些链接,我补充说:
:enable_starttls_auto => false,
:openssl_verify_mode => 'none'
到 development.rb,但没有帮助我。请帮帮我
【问题讨论】:
标签: ruby-on-rails devise