Pregunta

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!

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top