Ruby http.rb segmentation fault solution for OSX


If you’re encountering segmentation faults with your Ruby interpreter on your Mac, be it Ruby 1.8.6, 1.9.2, or 1.9.3, and your code involves interactions with HTTPS endpoints, the issue may stem from a faulty installation of OpenSSL via MacPorts.

To resolve this issue, you’ll need to build OpenSSL from source and then rebuild Ruby while specifying the path to the OpenSSL installation. If you’re like me and use RVM to manage different Ruby versions on your machine, here’s how you can do it:

rvm pkg install openssl
rvm uninstall 1.9.2
rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr

comments powered by Disqus