全新安装后持续出现 Ruby 段错误
当使用 Koala gem 通过 HTTP 进行通信时,Ruby 不断出现段错误:
/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,它安装了自己的 PostgreSQL 版本) OpenSSL)
- 运行
openssl version
返回OpenSSL 1.0.0g 18 Jan 2012
- 我从 RVM 中删除了 Ruby 1.9.3 并尝试卢西亚诺的以下方法不起作用。
- 我还尝试从 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/ (这是我上面的步骤,实际上)。我还读过克里斯托弗的上一篇文章 在这里。
在我的项目目录中,当我运行以下命令时,我得到了预期的
0
.:ruby -rubygems -e" 需要 'eventmachine'; 需要 'openssl' "; echo $?
- 我尝试过
sudo port -f deactivate openssl
但当我尝试启动 Rails 服务器时,我得到Library not returned: /opt/local/lib /libssl.1.0.0.dylib
我需要更多关于我还可以尝试什么或我错过的事情的想法。
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
I've tried the following:
- 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" require 'eventmachine'; require 'openssl' "; echo $?
- I've tried to
sudo port -f deactivate openssl
but then when I try to start a Rails server I getLibrary not loaded: /opt/local/lib/libssl.1.0.0.dylib
I need some more ideas on what else I can try, or things I've missed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我也遇到了同样的分段错误错误,但我正在尝试列出 AWS-S3 上的文件。
编辑:
这种方式对我有用:
I'm also getting this same Segmentation Fault error, but I'm trying to list files on AWS-S3.
Edit:
This way worked for me:
问题似乎是 Homebrew 和 MacPorts 冲突,所以我删除了 MacPorts,删除了所有包和
/opt/local/
目录。由于 Homebrew 上安装了 PostgreSQL,这导致 PG gem 出现一些问题。所以我删除了 Postgres 公式,然后重新安装它,并使用 Homebrew 进行 OpenSSL 安装。
之后,我内爆了 RVM 并再次安装了它和我的红宝石(不确定这一步是否必要),最后它起作用了。
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.So I deleted the Postgres formula, then reinstalled it and ditto for the OpenSSL installation using Homebrew.
After that I imploded RVM and installed it and my Rubies again (not sure if this step was necessary) and finally it works.
我也遇到了这个问题,但使用了不同的解决方案。这是错误的完整堆栈跟踪。
这是官方错误报告: http://bugs.ruby-lang.org/issues/6184 堆栈跟踪下面的响应非常有帮助。
这听起来类似于我最近遇到的一个问题,当 MacPorts 中安装的 readline 库破坏了 ruby 安装。在损坏的 ruby 安装上运行以下脚本显示它正在加载 MacPorts openssl lib
(输出)。
解决方案是在安装 ruby 时暂时将 MacPorts 从
/opt/local
移出。sudo mv /opt/local /opt/localbak
sudo mv /opt/localbak /opt/local
之后,ruby 安装与 MacPorts 一起正常工作,并且没有从 MacPorts 加载 libssl 文件。
I ran into this issue, too, but used a different solution. Here's the full stack trace of the error.
Here is the official bug report: http://bugs.ruby-lang.org/issues/6184 The responses below the stack trace were very helpful.
This sounded similar to an issue for me recently when the readline library installed in MacPorts broke a ruby installation. Running the following script on the broken ruby installation showed it was loading the MacPorts openssl lib
(the output)
The solution was to temporarily move MacPorts out of
/opt/local
while installing ruby.sudo lsof | grep /opt/local
.sudo mv /opt/local /opt/localbak
sudo mv /opt/localbak /opt/local
After that, the ruby installation worked properly alongside MacPorts and did not load the libssl file from MacPorts.