Persistent Ruby segfaulting after a clean install

心已入冬 提交于 2019-12-06 01:49:42
Luciano Costa

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:

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:$HOME/.rvm/bin
rvm remove 1.9.3 
rvm pkg install iconv
rvm pkg install openssl
rvm install ruby-1.9.3 --with-openssl-dir=~/.rvm/usr --with-iconv-dir=~/.rvm/usr
  • as @Simpleton said, I wrote a comment in the wrong place. Now I'm editing it with a response. ;-)

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.

John Douthat

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.

If you're using OS X's default openssl -> do like brew install openssl and build with installed openssl, then try again.

If you're using openssl that installed by user -> build with OS X default ssl and try again.

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

require 'net/https'
puts `lsof -p #{$$} | grep ssl | awk '{print $9}'`

(the output)

/Users/john/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.2.0/openssl.bundle
/opt/local/lib/libssl.1.0.0.dylib

The solution was to temporarily move MacPorts out of /opt/local while installing ruby.

  1. Quit all processes that are accessing MacPorts files. You can see which ones are running with sudo lsof | grep /opt/local.
  2. sudo mv /opt/local /opt/localbak
  3. Open a new terminal, then compile and install Ruby
  4. sudo mv /opt/localbak /opt/local

After that, the ruby installation worked properly alongside MacPorts and did not load the libssl file from MacPorts.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!