从 Rails 3.2 发送简单邮件时出现分段错误

发布于 2025-01-08 04:50:41 字数 1266 浏览 1 评论 0 原文

所以我不太确定在这里做什么。

我有一个基本完成的简单应用程序,它的主要目的是收集婚礼的回复。我设置了一个简单的邮件程序,每当输入新的 RSVP 时都会通知我,这在日志中看起来是有效的。然而,每当我实际告诉它在开发中执行交付时,就会出现分段错误,并且 Rails 服务器崩溃。我在 github 上发布了 Rails 项目中的一个错误,他们说这与我与 OpenSSL 的交互有关,我认为我没有使用 OpenSSL。 (这是一个从头开始的 Rails 3.2 应用程序,没有什么特别或奇怪的配置)

  config.action_mailer.default_url_options = { :host => 'gmail.com' }
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    :address              => "smtp.gmail.com",
    :domain               => 'gmail.com',
    :port                 => 587,
    :user_name            => '[email protected]',
    :password             => 'secret',
    :authentication       => 'plain',
    :enable_starttls_auto => true  }
  config.action_mailer.raise_delivery_errors = true

它会生成一个巨大的日志,该日志发布在 github 上: https://github.com/rails/rails/issues/5115

所以我不知道从这里去哪里。我从 rvm 安装了 openssl 软件包,该软件包成功构建并安装,并且我还尝试按照 github 建议从配置文件中删除 enable_starttls_auto ,但它一直崩溃。

我通过 RVM 运行 Ruby 1.9.3-p0,在 OS X Lion 上运行 Rails 3.2.0

So I'm not quite sure what to do here.

I've got a simple application that's basically done, it's main purpose is to collect RSVPs for a wedding. I set up a simple Mailer to notify me whenever a new RSVP is entered, which looks like in the log it works. However whenever I actually tell it to perform deliveries in dev, there's a segmentation fault and the rails server crashes. I posted a bug in the rails project over on github, and they said it's something to do with my interaction with OpenSSL, which I didn't think I was using. (this is a from scratch rails 3.2 app, nothing special or weird configuration wise)

  config.action_mailer.default_url_options = { :host => 'gmail.com' }
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    :address              => "smtp.gmail.com",
    :domain               => 'gmail.com',
    :port                 => 587,
    :user_name            => '[email protected]',
    :password             => 'secret',
    :authentication       => 'plain',
    :enable_starttls_auto => true  }
  config.action_mailer.raise_delivery_errors = true

it produces a giant log, which is posted over at github: https://github.com/rails/rails/issues/5115

So I'm not sure where to go from here. I installed the openssl package from rvm, which successfully built and installed, and I also tried removing enable_starttls_auto from the config file at the github suggestion, but it just keeps crashing.

I'm running Ruby 1.9.3-p0 through RVM, and rails 3.2.0 on OS X Lion

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓬勃野心 2025-01-15 04:50:41

我最终按照此处的说明操作: Lion:问题RVM 安装 rubies - 与 openssl 相关的问题,并让 ruby​​ 与开放 SSL 一起工作。邮件发送成功,不再出现服务器崩溃的问题。万岁!

I ended up following the instructions here: Lion: Problem with RVM installing rubies - problem related to openssl and got ruby working with open SSL. The mail sent successfully and no longer has any problems with crashing the server. Hooray!

娇柔作态 2025-01-15 04:50:41

他们认为问题出在 Rails 与 OpenSSL 的交互上,这是正确的。这篇文章总结得非常好。 http://www.22ideastreet.com/debug/smtp-rb14- bug-segmentation-fault/

修复方法是将其添加到您的 .bashrc/.zshrc/.bash_profile 中

export RUBYOPT="-ropenssl" 

They are correct that the issues is with Rails' interaction with OpenSSL. This post sums it up amazingly well. http://www.22ideastreet.com/debug/smtp-rb14-bug-segmentation-fault/

The fix is to add this to your .bashrc/.zshrc/.bash_profile

export RUBYOPT="-ropenssl" 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文