update – this needs to have a recent version of RVM – it works with rvm 1.10 but not with 1.6 – do an rvm update first.
When using the mighty cobweb web crawler on my OSX 10.7 with Ruby 1.9.3 I was getting a seg fault in net http:
net/http.rb:799: [BUG] Segmentation fault
A bit of googling and isolation in IRB showed that this can be caused when hitting HTTPS urls using net http.
I saw a few different solutions to the problem, primarily talking about Ruby 1.9.2.Surprisingly it took me a while to end up at the RVM documentation about the problem: https://rvm.beginrescueend.com/packages/openssl/. This didn’t quite work out of the box for me, so I used the solution in the following gist.
1
2
3
and now I can happily crawl https urls.
Related posts:










Yee-haw! I had a similar problem with Net::LDAP segfaulting after upgrading rails from 3.1.0 to 3.2.1 and ruby from 1.9.2 to 1.9.3. I could not find anyone on the ‘net with the same problem, but I did get as far as determining that it had to be an OpenSSL problem on my OSX Lion. Your steps above solved my problem. Thanks!
[...] So, the failure was while doing a bundle install at the end of creating a new rails application, which’s new in rails (to me anyway. It’s been a while since I last looked into rails). Googling for ruby segfault in http.rb pointed towards issues with OpenSSL. Then I found this post that describes how to fix the issue: http://www.rojotek.com/blog/2012/01/20/how-to-get-openssl-in-ruby-1-9-3-working-on-osx-10-7-fixing-t… [...]