Snow Leopard; no suitable image found... LoadError .. nokogiri.bundle: mach-o, but wrong architecture

458 views
Skip to first unread message

Jason FB

unread,
Feb 22, 2010, 3:22:35 PM2/22/10
to nokogiri-talk
/usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.0.20091120000117/lib/
nokogiri/nokogiri.bundle: dlopen(/usr/local/lib/ruby/gems/1.8/gems/
nokogiri-1.4.0.20091120000117/lib/nokogiri/nokogiri.bundle, 9): no
suitable image found. Did find: (LoadError)
/usr/local/lib/ruby/gems/1.8/gems/
nokogiri-1.4.0.20091120000117/lib/
nokogiri/nokogiri.bundle: mach-o, but wrong architecture - /usr/local/
lib/ruby/gems/1.8/gems/nokogiri-1.4.0.20091120000117/lib/nokogiri/
nokogiri.bundle
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:
31:in `require'


Unfinished post at http://groups.google.com/group/nokogiri-talk/browse_thread/thread/0040fff5001d4cf8/eb9f264f8869e4ae#

post seems to not let me reply it (may be too old)...

It seems this happens to people who upgrade to Snow Leopard and the
old libraries are still there.

Yes, rebuilding ruby did it for me too. See
http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard

Note: Just so you know, I actually did a clean install of Snow Leopard
because I thought it would help. In theory it did, but what I think
happened is that I used Migration Assistant to pull all my old stuff
from my Time Machine backup. I thought this would avoid the problem of
the old libraries, but somehow it pulled them in. Time Machine's 4th
option is for "File on the system" (the other 3 being User data, apps,
network settings). My theory is that this pulls either stuff in /
System or /Library (root of your drive) and/or maybe stuff in hidden
folders at the root of your drive.

So I'm not sure what had to be rebuilt, but I was getting architecture
problems on lots of things.

Check this out about how to uninstall & rebuild everything in
MacPorts, too:
http://trac.macports.org/wiki/Migration

In particular this also happens with Ruby's mysql's bindings -- not
related directly but if you're here you probably want to know about
these links too:

http://techliberty.blogspot.com/2009/12/dealing-with-rake-aborted-uninitialized.html
http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard
http://stackoverflow.com/questions/991708/rails-mysql-and-snow-leopard

In the end, my nokogiri architecture problem went away after I rebuilt
ruby from the instructions on HiveLogic.
-Jason

Gregory Clarke

unread,
Feb 22, 2010, 5:48:51 PM2/22/10
to nokogi...@googlegroups.com
> /usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.0.20091120000117/lib/
> nokogiri/nokogiri.bundle: dlopen(/usr/local/lib/ruby/gems/1.8/gems/
> nokogiri-1.4.0.20091120000117/lib/nokogiri/nokogiri.bundle, 9): no
> suitable image found. Did find: (LoadError)
> /usr/local/lib/ruby/gems/1.8/gems/
> nokogiri-1.4.0.20091120000117/lib/
> nokogiri/nokogiri.bundle: mach-o, but wrong architecture - /usr/local/
> lib/ruby/gems/1.8/gems/nokogiri-1.4.0.20091120000117/lib/nokogiri/
> nokogiri.bundle
> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
> custom_require.rb:
> 31:in `require'

Rubygems on Leopard will compile nokogiri as a 32-bit universal (ppc + i386) and ruby runs as 32-bit.

On Snow Leopard, ruby runs as 64-bit, so the old Leopard nokogiri gem won't have the right architecture. A reinstall on Snow Leopard should be all you need to do. From memory, when I moved to Snow Leopard, Migration Assistant moved all my gems over. The ones that aren't compiled would still run, but to save time I just did a sudo gem install of each one.

Hope this helps,

Greg

Reply all
Reply to author
Forward
0 new messages