Nokogiri on JRuby using OSX 10.5 and Mac Ports

C

Clifford Heath

I'm testing some code that uses Nokogiri under JRuby using rvm.
I have a fresh rvm install of JRuby, Nokogiri 1.4.3.1-java,
and the MacPorts 1.1.26_0 version of libxslt, which provides
/opt/local/lib/libexslt.dylib (i.e. everthing is up-to-date
except OSX)

I'm getting this stack trace:

~/.rvm/rubies/jruby-1.5.3/lib/ruby/site_ruby/shared/ffi/ffi.rb:112:in `create_invoker': Function 'xmlSchemaValidateFile' not found in [libexslt.dylib] (FFI::NotFoundError)
from /Users/cjh/.rvm/rubies/jruby-1.5.3/lib/ruby/site_ruby/shared/ffi/library.rb:98:in `attach_function'
from /Users/cjh/.rvm/rubies/jruby-1.5.3/lib/ruby/site_ruby/shared/ffi/library.rb:96:in `each'
from /Users/cjh/.rvm/rubies/jruby-1.5.3/lib/ruby/site_ruby/shared/ffi/library.rb:96:in `attach_function'
from /Users/cjh/.rvm/gems/jruby-1.5.3/gems/nokogiri-1.4.3.1-java/lib/nokogiri/ffi/libxml.rb:289
from /Users/cjh/.rvm/gems/jruby-1.5.3/gems/nokogiri-1.4.3.1-java/lib/nokogiri/ffi/libxml.rb:31:in `require'
from /Users/cjh/.rvm/rubies/jruby-1.5.3/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/cjh/.rvm/gems/jruby-1.5.3/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
from /Users/cjh/.rvm/gems/jruby-1.5.3/gems/nokogiri-1.4.3.1-java/lib/nokogiri.rb:11
... 14 levels...
from /Users/cjh/.rvm/gems/jruby-1.5.3/gems/rspec-core-2.1.0/lib/rspec/core/runner.rb:46:in `run'
from /Users/cjh/.rvm/gems/jruby-1.5.3/gems/rspec-core-2.1.0/lib/rspec/core/runner.rb:10:in `autorun'
from :1

Googling yields no answers. Any thoughts on the cause or the fix?

Clifford Heath.
 
C

Charles Oliver Nutter

It seems like it has to be a library version problem. Can you check
whether that version of libexslt matches what Nokogiri wants? It's
rather picky.

Alternatively, we are looking for people to test out the 1.5.0 betas,
which on JRuby are 100% Java-based and have no native library
dependencies. Maybe you can give it a shot?
 
M

Mike Dalessio

[Note: parts of this message were removed to make it a legal post.]

Hi,

I'm testing some code that uses Nokogiri under JRuby using rvm.
I have a fresh rvm install of JRuby, Nokogiri 1.4.3.1-java,
and the MacPorts 1.1.26_0 version of libxslt, which provides
/opt/local/lib/libexslt.dylib (i.e. everthing is up-to-date
except OSX)

I'm getting this stack trace:

~/.rvm/rubies/jruby-1.5.3/lib/ruby/site_ruby/shared/ffi/ffi.rb:112:in
`create_invoker': Function 'xmlSchemaValidateFile' not found in
[libexslt.dylib] (FFI::NotFoundError)
from
/Users/cjh/.rvm/rubies/jruby-1.5.3/lib/ruby/site_ruby/shared/ffi/library.rb:98:in
`attach_function'
from
/Users/cjh/.rvm/rubies/jruby-1.5.3/lib/ruby/site_ruby/shared/ffi/library.rb:96:in
`each'
from
/Users/cjh/.rvm/rubies/jruby-1.5.3/lib/ruby/site_ruby/shared/ffi/library.rb:96:in
`attach_function'
from
/Users/cjh/.rvm/gems/jruby-1.5.3/gems/nokogiri-1.4.3.1-java/lib/nokogiri/ffi/libxml.rb:289
from
/Users/cjh/.rvm/gems/jruby-1.5.3/gems/nokogiri-1.4.3.1-java/lib/nokogiri/ffi/libxml.rb:31:in
`require'
from
/Users/cjh/.rvm/rubies/jruby-1.5.3/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from
/Users/cjh/.rvm/gems/jruby-1.5.3/gems/polyglot-0.3.1/lib/polyglot.rb:64:in
`require'
from
/Users/cjh/.rvm/gems/jruby-1.5.3/gems/nokogiri-1.4.3.1-java/lib/nokogiri.rb:11
... 14 levels...
from
/Users/cjh/.rvm/gems/jruby-1.5.3/gems/rspec-core-2.1.0/lib/rspec/core/runner.rb:46:in
`run'
from
/Users/cjh/.rvm/gems/jruby-1.5.3/gems/rspec-core-2.1.0/lib/rspec/core/runner.rb:10:in
`autorun'
from :1
Can you post the results of "nokogiri -v" please?

This is probably because you're using an old version of libxml2 (<= 2.6.26,
which is very old, but I imagine if you're on a Mac this means you're
running Leopard with stock libxml 2.6.16, which is very VERY old, and buggy,
and not supported. see
http://nokogiri.org/tutorials/installing_nokogiri.html for more
information.).
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top