2

I followed the instructions specified in the GUIDE to use mechanize, but when I try to get an HTTPS page, I get a segfault.

require 'rubygems'
require 'mechanize'

agent = Mechanize.new

ruby-1.9.3-p0 :005 > agent.get("https://google.com")
/Users/wlue/.rvm/gems/ruby-1.9.3-p0/gems/net-http-persistent-2.3.3/lib/net/http/persistent/ssl_reuse.rb:70: [BUG] Segmentation fault

I'm wondering if I have rvm incorrectly configured somehow, but I don't know how to test that. I also have this in my top level .rvmrc, if that helps

export rvm_path="/Users/wlue/.rvm"

I don't think this is a ruby bug, because no one else has had problems with calling get on an https page, but I'm at a loss as to how to debug this.

edit: Turns out it's actually caused by an interaction with Rails. When I go directly to IRB it works fine, but rails console doesn't.

Waynn Lue
  • 11,344
  • 8
  • 51
  • 76
  • I see you do it on OSX, which version is it ? also which version of Xcode/osx-gcc-installer are you using, and have you used `--with-gcc=clang` ? – mpapis Feb 12 '12 at 09:28
  • I'm running OS X 10.6.8, I don't think I've installed Xcode at all on this box yet. It's rails so not sure why I'd need Xcode (or gcc)? :) – Waynn Lue Feb 13 '12 at 06:00
  • you need one of this two as they provide GCC which is required to compile rubies, also you need openssl to make the above to work, again GCC needed for it to compile, please read `rvm requirements` it shows what you need for a ruby to work – mpapis Feb 13 '12 at 16:03
  • I ended up uninstalling rvm and trying rbenv with similarly no luck. I've read that it's actually a passenger 1.0.5 bug, but haven't been able to test it to figure out. We don't see this in production, only in development unfortunately. – Waynn Lue Feb 19 '12 at 01:45
  • is it the same bug on ruby-1.9.3-p125 ? there is a patch available via `rvm get head` that could have additional impact on ruby. – mpapis Mar 21 '12 at 20:10
  • It didn't fix it, but I do appreciate the effort -- can I award the bounty to you still? – Waynn Lue Mar 27 '12 at 00:05

1 Answers1

1

I was having this problem, but it seems to work now in ruby 1.9.3p194

sguha
  • 2,057
  • 1
  • 22
  • 36