about

writing

contact

Stopping Curb From Segfaulting

By eric

2010-07-08

While trying to get the curb gem up and running using Ruby 1.8.7p174, I kept getting segmentation faults. I Google’d around and really wasn’t able to come up with much other than lots of people saying not to use ports here. Since I don’t use Mac Ports, I use Homebrew, I figured this wasn’t an issue. I had also recently installed the latest XCode so I incorrectly assumed there was no issue there either. (Note: I am running on a freshly upgraded version of Mac OS X Snow Leopard).
Since everything built correctly, I just assumed it would work correctly. Here it is obviously not doing so.

So I narrowed it down to what I believe is an issue with the curl headers. The solution is to install a new curl library. Since I wanted to do it the Homebrew way, and Homebrew doesn’t have curl by default, here is what I did.

Now you have to uninstall and reinstall the curb gem. The easiest way that I found (since I have bundler installed) was to do bundle show curb to find out where the gem is located. I removed the directory and reran bundle install (or gem install curb if you don’t have bundler).

Because I am using rvm (Ruby Version Manager), I actually encountered this issue with 1.9.1p378 as well. This fixed the issue for both versions.

unimatrixZxero

Yeah, this solved my problem. I had another little caveat though. I had MAMP installed and it has it's own version of curl. Which was in my path for connivence, ironically as it turns out.