nokogiri error on snow leopard

E

Emmanuel Mercado

hi,

below is the setup i have:
Mac OS X Snow Leopard
running ruby 1.8.7 installed using hivelogic procedure

installed libxml2 and libxslt from source
installed nokogiri 1.4.2 using sudo gems


EMercados-MacBook-Pro:~ ermercado$ gem list

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
cgi_multipart_eof_fix (2.5.0)
cheat (1.2.1)
daemons (1.0.10)
eventmachine (0.12.10)
fastthread (1.0.7)
gem_plugin (0.2.3)
mongrel (1.1.5)
mysql (2.8.1)
nokogiri (1.4.2, 1.3.3)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rspec (1.2.9)
rubygems-update (1.3.6)
sqlite3-ruby (1.2.5)
thin (1.2.4)


why am i getting the following message when i issue 'require nokogiri'
on irb?

EMercados-MacBook-Pro:~ ermercado$ irb
irb(main):001:0> require 'nokogiri'
LoadError:
dlopen(/usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle,
9): no suitable image found. Did find:
/usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle:
mach-o, but wrong architecture -
/usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle
from
/usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from
/usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri.rb:13
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`gem_original_require'
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`require'
from (irb):1


even after issuing the below command:

EMercados-MacBook-Pro:~ ermercado$ export RUBYOPT="rubygems"

thanks very much for your help
manny
 
R

Ryan Davis

hi,
=20
below is the setup i have:
Mac OS X Snow Leopard
running ruby 1.8.7 installed using hivelogic procedure
=20
installed libxml2 and libxslt from source
installed nokogiri 1.4.2 using sudo gems
[...]
=20
why am i getting the following message when i issue 'require nokogiri'
on irb?
=20
EMercados-MacBook-Pro:~ ermercado$ irb
irb(main):001:0> require 'nokogiri'
LoadError:
=
dlopen(/usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokog=
iri.bundle,

If you're on snow leopard, then why not skip the hivelogic crap and use =
stock everything? It Just Works(tm).

If not, then try otool to figure out what went wrong:

509 % otool -L =
/Library/Ruby/Gems/1.8/gems/nokogiri-1.4.1/lib/nokogiri/nokogiri.bundle
/Library/Ruby/Gems/1.8/gems/nokogiri-1.4.1/lib/nokogiri/nokogiri.bundle:
=
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/libruby.1.d=
ylib (compatibility version 1.8.0, current version 1.8.7)
/usr/lib/libexslt.0.dylib (compatibility version 9.0.0, current =
version 9.13.0)
/usr/lib/libxslt.1.dylib (compatibility version 3.0.0, current =
version 3.24.0)
/usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current =
version 10.3.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current =
version 125.0.0)
 
E

Eric Hodel

On Jun 12, 2010, at 06:00 , Emmanuel Mercado wrote:
=20
hi,
=20
below is the setup i have:
Mac OS X Snow Leopard
running ruby 1.8.7 installed using hivelogic procedure
=20
installed libxml2 and libxslt from source
installed nokogiri 1.4.2 using sudo gems
[...]
=20
why am i getting the following message when i issue 'require = nokogiri'
on irb?
=20
EMercados-MacBook-Pro:~ ermercado$ irb
irb(main):001:0> require 'nokogiri'
LoadError:
=
dlopen(/usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokog=
iri.bundle, 9): no suitable image found. Did find:/usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bun=
dle: mach-o, but wrong architecture -
=20
If not, then try otool to figure out what went wrong:

If it's an architecture problem, file might be better:

$ file `which ruby`
/usr/bin/ruby: Mach-O universal binary with 3 architectures
/usr/bin/ruby (for architecture x86_64): Mach-O 64-bit executable =
x86_64
/usr/bin/ruby (for architecture i386): Mach-O executable i386
/usr/bin/ruby (for architecture ppc7400): Mach-O executable ppc

$ file `gem which nokogiri/nokogiri`
/Library/Ruby/Gems/1.8/gems/nokogiri-1.4.1/lib/nokogiri/nokogiri.bundle: =
Mach-O 64-bit bundle x86_64

For me, nokogiri is probably x86_64 only because the libxml is x86_64 =
only:

$ port installed libxml2
The following ports are currently installed:
libxml2 @2.7.6_0 (active)

Here's a universal variant:

$ port installed freeimage
The following ports are currently installed:
freeimage @3.13.1_0+universal (active)
 
S

Sora Harakami

hi,

'No suitable image found' error occurs if arch different between ruby
and library.

And snow leopard builds 64bit in default. but snow leopard's ruby is
built in 32bit.

so i think build ruby yourself and reinstall gems.
 
R

Ryan Davis

'No suitable image found' error occurs if arch different between ruby
and library.

And snow leopard builds 64bit in default. but snow leopard's ruby is
built in 32bit.

so i think build ruby yourself and reinstall gems.

again... stock ruby would have saved you pain:
 
S

Sora Harakami

Sorry for I missed that post.
hmm.... I think bad is "universal binary".

build ruby yourself to quickly make happy. :D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top