Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Persistent Ruby segfaulting after a clean install

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 returns OpenSSL 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 since which 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 get Library 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.

like image 422
Simpleton Avatar asked Dec 31 '25 16:12

Simpleton


1 Answers

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. ;-)
like image 124
Luciano Costa Avatar answered Jan 02 '26 10:01

Luciano Costa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!