好吧 - 我在这里头了。我使用的是:Rails 3 - 设计/ ActionMailer/RUBY-SMTP导致分段错误
- ruby-1.9.3-p0
- rails-3.1.3
- mail-2.3.0
- devise-1.5.3
试图把对设计的:confirmable
选项,并在我的应用程序启动SMTP服务。只要我添加/config/initializers/setup_mail.rb
,在我的数据库中添加Devise的必要列,并且:confirmable
属性添加到我的User
模型中,我会得到分段错误。它在用户注册后立即发生。 Devise
试图发送确认邮件,引起红宝石SMTP库具有以下崩溃:
... lib/ruby/1.9.1/net/smtp.rb:583: [BUG] Segmentation fault
在log/development.log
中的最后一项:
Rendered devise/mailer/confirmation_instructions.html.erb (1.2ms)
我/config/initializers/setup_mail.rb
文件:
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "mydomain.com",
:user_name => "[email protected]",
:password => "???????",
:authentication => "plain",
:enable_starttls_auto => true
}
ActionMailer::Base.default_url_options[:host] = "localhost:3000"
我的config/environments/development.rb
文件具有以下内容:
config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
这里是红宝石/ 1.9.1 /网/ smtp.rb锗代码(行583是中间附近):
def ssl_socket(socket, context)
OpenSSL::SSL::SSLSocket.new socket, context
end
def tlsconnect(s)
verified = false
s = ssl_socket(s, @ssl_context)
logging "TLS connection started"
s.sync_close = true
s.connect # THIS IS LINE 583
if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
s.post_connection_check(@address)
end
verified = true
s
ensure
s.close unless verified
end
它看起来像分割故障时,SMTP试图发生通过SSL套接字连接(s.connect
)连接。在setup_mail.rb
我试过将:enable_starttls_auto
设置为true
和false
。当它设置为false
但没有电子邮件熄灭时,我不会收到分段错误,所以这是没用的。
我很容易能够从我的Mac运行此命令连接到Gmail的SMTP服务:
$ telnet smtp.gmail.com 587
不知道从哪里何去何从 - 有什么建议?
操作系统?如果Windows ...:X – 2012-01-27 07:20:28
我正在运行MacOS 10.7.2。 – 2012-01-27 07:33:42
我有同样的问题:( – Kir 2012-01-31 18:35:25