f4hyqw
Last Updated: February 25, 2016
·
6.561K
· phlipper
B61ce134adf2d6eb1d1f1d11122d6142

Fix Ruby 1.9.x OpenSSL Segfault on OS X

If you install Ruby 1.9.2 or 1.9.3 on OS X, you may run in to the dreaded OpenSSL segfault:

~/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]

The version of OpenSSL that ships with OS X 10.6 and 10.7 is older and causes this issue.

There are a number of options solve this. Here a few:

MacPorts

port selfupdate
port install openssl
port install libyaml

# RVM
rvm install 1.9.3 --with-openssl-dir=/opt/local --with-opt-dir=/opt/local

# rbenv
CONFIGURE_OPTS='--with-openssl-dir=/opt/local --with-opt-dir=/opt/local' rbenv install 1.9.3-p194

Homebrew

brew update
brew install openssl

# RVM
rvm install 1.9.3 --with-openssl-dir=`brew --prefix openssl`

# rbenv
CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`" rbenv install 1.9.3-p194

RVM

rvm pkg install openssl
rvm reinstall 1.9.3 --with-openssl-dir=$rvm_path/usr

6 Responses
Add your response

947
2014 07 31 18.14.34 hdr

worked great for me + rbenv! Thanks phlipper!

over 1 year ago ·
948
B61ce134adf2d6eb1d1f1d11122d6142

@dickeyxxx great, glad to help!

over 1 year ago ·
1611
1f7b1b1af06418dd2e83414f8de429a2

Thanks! Helped a lot

over 1 year ago ·
1612
B61ce134adf2d6eb1d1f1d11122d6142

@ochko great, thanks!

over 1 year ago ·
3130
B6ae0b5eeb3911e2b8a622000a1fbdb1 7

Thanks a lot!

over 1 year ago ·
4919

Awesome! Tried to figure this out for hours before I found this.

over 1 year ago ·