views:

219

answers:

1

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

A: 

I see a lot of /opt/local stuff with the gcc output--are you using MacPorts? If so, you might be getting some funkiness as a result of using this other quasi-different environment--I ran in to all kinds of issues like this after upgrading to 10.6 with MacPorts and as a result switched to using rvm (http://rvm.beginrescueend.com/) for my Ruby upgrading/management and have been using Homebrew (http://mxcl.github.com/homebrew/) for a MacPorts replacement.

Does this help at all?

turboladen
Your mention of RVM gets you a green check. The day before, I installed it and used it to update my version of Ruby to the latest patch level. Now everything is fine. So the answer to my question in a nutshell would be "An unupdated version of Ruby would cause native gem extensions on OSX to build but fail to load." Thanks for your advice. -Michael
goodmike