Ibxml2 woes

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:inmap’
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:inrequire’
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:inrequire’
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

I had problems with Nokogiri too and decided to use the pure java
implementation prerelease gem. I had to change a bit of my code because
Node.next behaves a little different, but other than that it was better
than a custom installation procedure.
For details try:Â jruby -S gem list -r -d nokogiri --prereleaseor
install:Â jruby -S gem install nokogiri --prereleaseBackup whatever you
think might be ruined.

— On Fri, 6/4/10, Peter S. [email protected] wrote:

From: Peter S. [email protected]
Subject: [jruby-user] ibxml2 woes
To: [email protected]
Date: Friday, June 4, 2010, 2:43 PM

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

Hi

On Fri, Jun 4, 2010 at 5:15 PM, Yonatan E. [email protected]
wrote:

I had problems with Nokogiri too and decided to use the pure java
implementation prerelease gem. I had to change a bit of my code because
Node.next behaves a little different, but other than that it was better than
a custom installation procedure.

What’s the difference of Node.next? Different behavior should be a bug,
so
would you file the bug at http://github.com/tenderlove/nokogiri/issues
with
pure-java tag?

Pure Java Nokogiri has not yet completed. Several failures and errors
are
reported from rake test now. You might hit one of them.

-Yoko

I’d also love to hear about your experiences using the Java version. We
know
there are probably perf differences (it has had no optimization) and may
be
functionality differences, but it is most definitely the right path
forward.

Thanks Yonatan - after spending 3 days trying to install the non-java
version, I had the java one up and running in 3 minutes… definitely
easier. I am hoping I won’t run into too much differences…

What should I look out for (except Node.next)? Any serious caveats?

Cheers,
Peter

On Sat, Jun 5, 2010 at 7:00 PM, Charles Oliver N.

On Mon, Jun 7, 2010 at 10:38 AM, Damian S. [email protected] wrote:

Bit late here, but it looks like your macports is building 32bit
binaries, whereas java on Leopard is 64 bit only (if memory serves).

Java 6 on Leopard is 64-bit only, correct. Java 5 I think can do
either 32 or 64-bit.

Java 6 on Snow Leopard can do both, but defaults to 64-bit.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On 04/06/10 12:43, Peter S. wrote:

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

Bit late here, but it looks like your macports is building 32bit
binaries, whereas java on Leopard is 64 bit only (if memory serves).

Damian


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I was surprised but my code just worked except I had to replace
“someNode.next” to “someNode.next_element”. I thought they were
synonyms.But, I wasn’t using the very latest native nokogiri when I
switched to the prerelease. I’ll have to setup c-ruby again and check
the latest c-nokogiri behavior.

— On Mon, 6/7/10, Peter S. [email protected] wrote:

From: Peter S. [email protected]
Subject: Re: [jruby-user] ibxml2 woes
To: [email protected]
Date: Monday, June 7, 2010, 12:50 PM

Thanks Yonatan - after spending 3 days trying to install the non-java
version, I had the java one up and running in 3 minutes… definitely
easier. I am hoping I won’t run into too much differences…

What should I look out for (except Node.next)? Any serious caveats?

Cheers,
Peter
Â

On Sat, Jun 5, 2010 at 7:00 PM, Charles Oliver N.
[email protected] wrote:

I’d also love to hear about your experiences using the Java version. We
know there are probably perf differences (it has had no optimization)
and may be functionality differences, but it is most definitely the
right path forward.

On Fri, Jun 4, 2010 at 4:15 PM, Yonatan E. [email protected]
wrote:

I had problems with Nokogiri too and decided to use the pure java
implementation prerelease gem. I had to change a bit of my code because
Node.next behaves a little different, but other than that it was better
than a custom installation procedure.

For details try:Â jruby -S gem list -r -d nokogiri --prereleaseor
install:Â jruby -S gem install nokogiri --prereleaseBackup whatever you
think might be ruined.

— On Fri, 6/4/10, Peter S. [email protected] wrote:

From: Peter S. [email protected]
Subject: [jruby-user] ibxml2 woes

To: [email protected]
Date: Friday, June 4, 2010, 2:43 PM

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