20

I'm going through the second edition of Ruby on Rails Tutorial (http://ruby.railstutorial.org/). I'm following each step, so I'm using Ruby 1.9.3 and when I run 'bundle install' inside my Rails project I an error with a big trace of the error which starts with this:

/Users/sebasoga/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0]

I'm now using Ruby 1.9.2 and it works fine, but shouldn't it also work with Ruby 1.9.3?

Sebastian Sogamoso
  • 333
  • 1
  • 3
  • 9
  • Possibly relevant, if you have MacPorts installed: http://stackoverflow.com/questions/9136694 –  May 27 '12 at 22:33

3 Answers3

42

This one worked for me:

rvm pkg install iconv
rvm pkg install openssl
rvm reinstall 1.9.3 --with-openssl-dir=~/.rvm/usr --with-iconv-dir=~/.rvm/usr

It's based in the solution on this blog. I also tried the one here, which is based on macports and it didn't work. But to be honest I didn't care updating my macports, so maybe that's why it didn't work.

Also I found these other two issues describing the problem and giving suggestions: 4050, 4766

tlbrack
  • 926
  • 7
  • 12
pedrofurla
  • 12,763
  • 1
  • 38
  • 49
  • I followed the rabbit hole and tried some of the other methods first, but ultimately installing openssl as an rvm pkg was what worked for me as well. If you don't use iconv, ignore that install. You may also want to use $rvm_path/usr if your rvm install is in an unusual location. – tlbrack Mar 21 '12 at 18:44
  • It's not related to the ssl/tls issue, but when building ruby on Lion with XCode 4.2, I also needed to add --with-gcc=clang per the thread at http://stackoverflow.com/questions/8032824/cant-install-ruby-under-lion-with-rvm-gcc-issues (edit 3 of the accepted answer) – pduey Apr 06 '12 at 15:24
6

In my Gemfile, replacing

source 'https://rubygems.org'

this line with

source 'http://rubygems.org'

solved the problem. Hope this helps!

ArjunUrs
  • 127
  • 1
  • 6
  • Thanks! It's looking for OpenSSL, but the poster doesn't have that package installed with Ruby, hence the accepted answer. However, by replacing https with http, you can remove the need for OpenSSL altogether without recompiling Ruby. – Schrockwell Nov 03 '12 at 05:30
0

Seems like there's an issue with a package in 1.9.3 and xcode 4.2 if you're running that? Spotted somewhere on SO that going back to 4.1 is a fix. I stayed with 1.9.2

ritchielee
  • 268
  • 1
  • 9