Hi guys,
I already posted this to the nokogiri list too, but since it doesn’t
seem to
be trivial, I figured it might be a good idea to ask here too.
I am on OS X Leopard. After installing the most recent versions of
everything (JRuby, libxml/libxslt, nokogiri), I am running into this:
oirb(main):004:0> require ‘nokogiri’
LoadError: Could not open library ‘xml2’ : dlopen(xml2, 5): image not
found.
Could not open library ‘libxml2.dylib’ : dlopen(libxml2.dylib, 5): no
suitable image found. Did find:
/opt/local/lib/libxml2.dylib: mach-o, but wrong architecture
/opt/local/lib/libxml2.dylib: mach-o, but wrong architecture
/opt/local/lib/libxml2.dylib: mach-o, but wrong architecture
/opt/local/lib/libxml2.dylib: mach-o, but wrong architecture
from
/Users/Marianna/devel/bin/jruby-1.5.0/lib/ruby/site_ruby/shared/ffi/library.rb:28:in
ffi_lib' from /Users/Marianna/devel/bin/jruby-1.5.0/lib/ruby/site_ruby/shared/ffi/library.rb:10:in
map’
from
/Users/Marianna/devel/bin/jruby-1.5.0/lib/ruby/site_ruby/shared/ffi/library.rb:10:in
ffi_lib' from /Users/Marianna/devel/bin/jruby-1.5.0/lib/ruby/gems/1.8/gems/nokogiri-1.4.2-java/lib/nokogiri/ffi/libxml.rb:13 from /Users/Marianna/devel/bin/jruby-1.5.0/lib/ruby/gems/1.8/gems/nokogiri-1.4.2-java/lib/nokogiri/ffi/libxml.rb:31:in
require’
from
/Users/Marianna/devel/bin/jruby-1.5.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from /Users/Marianna/devel/bin/jruby-1.5.0/lib/ruby/gems/1.8/gems/nokogiri-1.4.2-java/lib/nokogiri.rb:11 from /Users/Marianna/devel/bin/jruby-1.5.0/lib/ruby/gems/1.8/gems/nokogiri-1.4.2-java/lib/nokogiri.rb:36:in
require’
from
/Users/Marianna/devel/bin/jruby-1.5.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`require’
from (irb):4
Since port installed the most recent version of libxml into
/opt/local/lib,
it would be nice if JRuby looked it up there… however, that doesn’t
seem
to be the case:
$ export DYLD_PRINT_LIBRARIES=1
$ jirb
… snip …
dyld: loaded: /usr/lib/libxml2.2.dylib
… snip …
and I can’t seem to force JRuby to look for the libs in /opt/local/lib -
tried to set DYLD_LIBRARY_PATH=/opt/local/lib and
DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib to no avail…
Cheers,
Peter