0

I get the following output from irb (v 0.9.5) when I require mechanize and then curb:

$ irb
>> require 'mechanize'
=> true
>> require 'curb'
=> true
>>  

No problems there. However, when I require the libs in the other order, I get the following:

$ irb
>> require 'curb'
=> true
>> require 'mechanize'
/opt/local/lib/ruby/1.8/openssl/ssl-internal.rb:30: [BUG] Segmentation fault
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10]

Abort trap
$ 

The gems I'm using are the most recent versions for curb and mech (v 0.7.15 and 1.0.0, respectively). For ruby I'm using 1.8.7 (as seen above).

Also, I'm unfamiliar with the [BUG] error message. Does this mean that I've encountered a known bug in ssl?

Thanks in advance for the help!

peter
  • 161
  • 2
  • 8

1 Answers1

1

I can't duplicate it using the same versions of Mechanize and Curb on Linux or Mac OS:

Welcome to IRB. You are using ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux]. Have fun ;)
>> require 'rubygems' #=> false
>> require 'curb' #=> true
>> require 'mechanize' #=> true

Welcome to IRB. You are using ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-darwin10.6.0]. Have fun ;)
>> require 'rubygems' #=> false
>> require 'curb' #=> true
>> require 'mechanize' #=> true

Because your Ruby is in /opt, I suspect you installed it via MacPorts or similar. If you're running Snow Leopard, XCode that came on the DVD with Snow Leopard is known to be buggy and can cause seg faults. Updating it to the latest version from Apple's XCode site will fix the problem. You probably should reinstall Ruby if it was compiled under the old version.

Another problem I've seen that could cause this sort of error is installing Ruby under Leopard as 32-bit, then upgrading to Snow Leopard which is 64-bit. There's not enough information to be able to tell.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
  • Thanks tin man. Sorry for the lack of info in my post. I'm running Snow Leopard and had most likely installed Ruby while still on Leopard. I'd already reinstalled XCode a while back so I tried reinstalling Ruby (through MacPorts), but had no success in fixing the problem, unfortunately. – peter Apr 04 '11 at 17:42
  • I'm not sure how to force MaPorts to reinstall. With RVM it would be a `rvm uninstall 1.9.2` followed by a `rvm install 1.9.2`, which causes a recompile and results in the new version being at the right "bitted-ness". – the Tin Man Apr 04 '11 at 18:36