开发者

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

开发者 https://www.devze.com 2022-12-25 07:04 出处:网络
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, becaus

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开发者_如何学C 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


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 for my Ruby upgrading/management and have been using Homebrew for a MacPorts replacement.

Does this help at all?

0

精彩评论

暂无评论...
验证码 换一张
取 消