From: Dave Howell Date: 2010-06-18T04:57:21+09:00 Subject: Re: Dear gem: still no zlib. On Jun 17, 2010, at 12:34 , Ben Bleything wrote: > Upgrade installs aren't worth it, particularly from 10.5 -> 10.6. I > know that sucks to hear, but doing a clean install *will* fix your > problems. Actually, this WAS a clean install. It took me over a month to get all my tools re-installed. However, not all of the installers correctly installed 64-bit versions. Postgres was a particular nightmare. Because it stuffed 32-bit libraries all over the place, everything that linked to it automatically degraded to 32-bit, and I ended up with all kinds of stuff that didn't work. >> I had to actually go back and pull my own Ruby off my backups so that >> I had a 32-bit Ruby just so I could get work done. > > Perhaps an expedient solution, but not a very clean one. That's why I've been trying to get everything moved back up to 64-bit. > From your other post: > >> $ file /opt/local/lib/libz.dylib >> libz.dylib: Mach-O 64-bit dynamically linked shared library x86_64 >> So I have a 64-bit libz.dylib. Gem is ignoring my /opt tree. > > Why are you using macports for this? Every additional piece you add is > making solving your problem so much more complicated. Oh, I know, I know. I HATE MacPorts. I hate hate hate having to install something that is already on my system, but is 'too old' or the 'wrong version,' because I have wasted many hours chasing down problems from my command line using one version and XCode-developed apps using another. > You already have a > universal libz: > > $ file /Developer/SDKs/MacOSX10.6.sdk/usr/lib/libz.dylib > /Developer/SDKs/MacOSX10.6.sdk/usr/lib/libz.dylib: Mach-O universal > binary with 3 architectures > But these things *do* work fine on Snow Leopard, > using the stock ruby, without macports. You just need to start from a > clean spot, which you didn't do when you did the in-place upgrade. See above. In fact, it was impossible to get all this fixed without MacPorts, because that was the only way I could get a 64-bit version of Postgres. The packaged binary installer gave me 32-bit. I tried recompiling from the source version I had already, and it blew up in every direction with unfulfilled dependencies. I suspect zlib and libxml were dependencies of Postgres, and, of course, MacPorts would never link to the existing system libraries. Ewww. {roll eyes} But that certainly suggests a possible solution. "Erase" the MacPorts tree. $ mv /opt /non-opt $ gem install nokogiri Building native extensions. This could take a while... Successfully installed nokogiri-1.4.2 1 gem installed $ file .../lib/nokogiri/nokogiri.bundle lib/nokogiri/nokogiri.bundle: Mach-O universal binary with 2 architectures lib/nokogiri/nokogiri.bundle (for architecture i386): Mach-O bundle i386 lib/nokogiri/nokogiri.bundle (for architecture x86_64): Mach-O 64-bit bundle x86_64 Bloody hell. Thanks, Ben, you rock. Note to self: when Gem says "blahblahblah is missing" it's probably lying. Missing != wrong architecture.