Thursday, March 15, 2012

Ruby Segmentation Fault



Even if there was plenty of info around, it was still a pain.

I am using Snow Leopard with RVM and Ports.

First I tried:
rvm install ruby-1.9.3 --with-openssl-dir=/opt/local \
     --with-iconv-dir=/opt/local
as described in:
http://blog.55minutes.com/2012/01/fixing-a-segmentation-fault-in-ruby-193/

But even if I had the openssl 1.0 using ports and the latest iconv, it will stil give me an error.

Until I finally tried a combination of the answers at this post:
http://www.christopherirish.com/2011/09/02/ruby-1-9-2-segmentation-fault-and-openssl/

rvm remove ruby-1.9.3
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:$HOME/.rvm/bin
rvm pkg install iconv
rvm install ruby-1.9.3 --with-openssl-dir=/opt/local \
    --with-iconv-dir=$rvm_path/usr

Basically use openssl from ports but a local package for iconv.