I\'m getting the following error when trying to use Nokogiri with Jruby on Windows 7
D:\\code\\h4>jruby -e \"require \'rubygems\'; require \'nokogiri\'\"
D:/j
There is now a pure Java version that can run on Windows as well.
gem install nokogiri --pre
Found here
https://github.com/tenderlove/nokogiri/wiki/pure-java-nokogiri-for-jruby
The workaround you found is for a UNIX system; the .so file is a loadable module, similar to a DLL in Windows. And you can't softlink in Windows (the ln -s
command), so that doesn't apply in your situation.
Nonetheless, you do have the same problem in that nokogiri can't find your libxml2, libxslt, & libexslt libraries. Since I don't use JRuby or nokogiri, I'm really not sure how it'll work, but my best guess is this:
Most likely, you need Windows binaries (DLLs) of libxml2 and libxslt at a minimum; other related Windows binaries may be needed and are available at the same place. You'll want the DLLs installed somewhere in your path, or better yet in the same directory as your JRuby executable (looks like "D:/jruby-1.3.1/bin"). (If that doesn't work, perhaps a Java-native form of the libraries like libxmlj might work, but I doubt it--you probably need ones native to Windows.)
I expect that will get you on your way to working.
It is true that you need the xml2 / libxslt dlls in your path.
However, I have found it necessary to update to jruby-1.4.0RC2 (for some FFI improvements I believe).
Also, need to update to the latest nokogiri 1.3.3 & manually apply the following commit:
http://github.com/tenderlove/nokogiri/commit/0555c69e70083a6368b563f18da2c8d5416515cc
OR install nokogiri from github trunk.
I hope this is helpful.
Useful background links: