What would cause native gem extensions on OS X to build but fail to load?

Posted by goodmike on Stack Overflow See other posts from Stack Overflow or by goodmike
Published on 2010-03-30T16:09:40Z Indexed on 2010/03/30 16:53 UTC
Read the original article Hit count: 373

I am having trouble with some of my rubygems, in particular those that use native extensions.

I am on a MacBookPro, with Snow Leopard. I have XCode 3.2.1 installed, with gcc 4.2.1. Ruby 1.8.6, because I'm lazy and a scaredy cat and don't want to upgrade yet. Ruby is running in 32-bit mode. I built this ruby from scratch when my MBP ran OSX 10.4.

When I require one of the affected gems in irb, I get a Load Error for the gem extension's bundle file. For example, here's nokogigi dissing me:

> require 'rubygems'
=> true
> require 'nokogiri'
LoadError: Failed to load /usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.1/lib/nokogiri/nokogiri.bundle

This is also happening with the Postgres pg and MongoDB mongo gems.

My first thought was that the extensions must not be building right. But gem install wasn't throwing any errors. So I reinstalled with the verbose flag, hoping to see some helpful warnings. I've put the output in a Pastie, and the only warning I see is a consistent one about "passing argument n of ‘foo’ with different width due to prototype."

I suspect that this might be an issue from upgrading to Snow Leopard, but I'm a little surprised to experience it now, since I've updated my XCode. Could it stem from running Ruby in 1.8.6? I'm embarrassed that I don't know quite enough about my Mac and OSX to know where to look next, so any guidance, even just a pointer to some document I couldn't find via Google, would be most welcome.

Michael

© Stack Overflow or respective owner

Related posts about ruby

Related posts about osx-snow-leopard