我尝试通过 gmail 帐户使用 Devise 发送电子邮件后收到此错误消息
“Net::SMTP:Class 的未定义方法‘default_ssl_context’”
这是我的 production.rb 环境
require 'net/smtp'
require 'tlsmail'
require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
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 => 'gmail.com',
:authentication => :plain,
:user_name => 'myemail@myemail',
:password => 'password'
}
你以前见过这个错误吗?谢谢