How to use nokogiri from Jruby on Windows?

前端 未结 3 1658
温柔的废话
温柔的废话 2021-01-25 04:12

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         


        
3条回答
  •  有刺的猬
    2021-01-25 04:57

    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.

提交回复
热议问题