我刚刚升级到 Rails3.2.8
并更新了我所有的 gem。我想测试我的网站,所以我从注册开始,但是当我点击加入按钮时,它给了我错误:
OpenSSL::SSL::SSLError in RegistrationsController#create
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
app/models/user.rb:28:in `send_welcome_email'
我正在使用设计2.1.2
,这是我的用户模型:
class User < ActiveRecord::Base
attr_accessible :email, :password, :remember_me
attr_accessor :accessible # something for devise i think
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable,
:validatable, :email_regexp => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
after_create :send_welcome_email
private
def send_welcome_email
UserMailer.welcome_email(self).deliver
end
end
我猜这与我在development.rb中的电子邮件设置有关。
require 'tlsmail'
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => 'smtp.gmail.com',
:port => 587,
:tls => true,
:domain => 'app.com',
:authentication => :plain,
:user_name => 'support@app.com',
:password => '******'
}
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
我该如何纠正这个问题?我去的时候才开始明白这个3.2.8
。如果有帮助,我在 Windows 7 上。