全新安装后持续的 Ruby 段错误 [英] Persistent Ruby segfaulting after a clean install
问题描述
当使用 Koala gem 通过 HTTP 通信时,Ruby 不断出现段错误:
Ruby keeps segfaulting when using the Koala gem to talk over HTTP:
/Users/pawel/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault
我尝试了以下方法:
- 运行
which -a ruby
,通过 MacPorts 显示多个 Ruby.所以我删除了这些并再次运行相同的命令只返回/usr/bin/ruby
- 我已经删除了 PostgreSQL 的 MacPorts 版本,而是使用 Homebrew 安装了它(使用 MacPorts,它安装了自己的 OpenSSL 版本)
- 运行
openssl 版本
返回OpenSSL 1.0.0g 2012 年 1 月 18 日
- 我从 RVM 中删除了 Ruby 1.9.3 并尝试了 Luciano 的以下方法,但没有成功.
- 我还尝试从 RVM 重新安装 1.9.3 并指定
--with-openssl-dir=/opt/local
因为which openssl
返回/opt/local/bin/openssl
- 我已经重新安装了 RVM(现在是
/Users/pawel/.rvm/bin/rvm
中的 1.10.2 版) - 我已经升级到 Ruby 1.9.3-p125 并且也尝试过 1.9.2
- 我已按照此处的说明进行操作:http://www.christopherirish.com/2011/09/02/ruby-1-9-2-segmentation-fault-and-openssl/ (实际上是我上面的步骤).我还阅读了 Christopher 的上一篇文章 在这里.
在我的项目目录中,当我运行以下命令时,我得到了预期的
0
.:
- Run
which -a ruby
which showed multiple Rubies via MacPorts. So I deleted those and running the same command again returns only/usr/bin/ruby
- I've removed the MacPorts version of PostgreSQL and installed it with Homebrew instead (With MacPorts, it installs its own version of OpenSSL)
- Running
openssl version
returnsOpenSSL 1.0.0g 18 Jan 2012
- I removed Ruby 1.9.3 from RVM and tried Luciano's method below which didn't work.
- I've also tried reinstalling 1.9.3 from RVM and specifying
--with-openssl-dir=/opt/local
sincewhich openssl
returns/opt/local/bin/openssl
- I've reinstalled RVM (It's now version 1.10.2 in
/Users/pawel/.rvm/bin/rvm
) - I've upgraded to Ruby 1.9.3-p125 and have also tried on 1.9.2
- I've followed the instructions here: http://www.christopherirish.com/2011/09/02/ruby-1-9-2-segmentation-fault-and-openssl/ (which are my above steps, actually). I've also read Christopher's previous post here.
In my project directory when I run the following then I get the expected
0
.:
ruby -rubygems -e" 需要 'eventmachine';需要 'openssl'";回声 $?
我需要更多关于我可以尝试什么或我错过的东西的想法.
I need some more ideas on what else I can try, or things I've missed.
推荐答案
问题似乎是 Homebrew 和 MacPorts 冲突,所以我删除了 MacPorts,删除了所有包和 /opt/local/
目录.由于 Homebrew 上安装了 PostgreSQL,这导致 PG gem 出现一些问题.
The problem seemed to be that Homebrew and MacPorts were conflicting, so I deleted MacPorts, removed all packages and the /opt/local/
directory. This caused some issue with the PG gem due to the PostgreSQL installation on Homebrew.
所以我删除了 Postgres 公式,然后重新安装它并使用 Homebrew 安装 OpenSSL.
So I deleted the Postgres formula, then reinstalled it and ditto for the OpenSSL installation using Homebrew.
在那之后,我 imploded RVM 并再次安装了它和我的 Rubies(不确定这一步是否必要),终于可以正常工作了.
After that I imploded RVM and installed it and my Rubies again (not sure if this step was necessary) and finally it works.
这篇关于全新安装后持续的 Ruby 段错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!