Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gem intallation fails on "checking for xmlParseDoc() in -lxml2... no" With 64-bit libxml2 DLLs included with Gem (Windows) #125

Closed
SimonKaluza opened this issue Jul 29, 2016 · 2 comments

Comments

@SimonKaluza
Copy link

SimonKaluza commented Jul 29, 2016

If I use the new 64-bit libxml2-2.dll included at https://github.com/xml4r/libxml-ruby/tree/v2.9.0/lib/libs the compilation step of the native bindings fails during gem installations on Ruby 2.1.x with:

gem install libxml-ruby --platform=x64-mingw32
Building native extensions.  This could take a while...
ERROR:  Error installing libxml-ruby:
        ERROR: Failed to build gem native extension.

    D:/Ruby21-x64/bin/ruby.exe extconf.rb
checking for libxml/xmlversion.h in /opt/include/libxml2,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... yes
checking for xmlParseDoc() in -lxml2... no
*** extconf.rb failed ***

Oddly enough, if I replace the libxml2 DLL with the one contained in this distribution https://forge.imag.fr/frs/?group_id=184&release_id=320 the gem compiles and installs successfully but it then fails at run-time with:

irb(main):001:0> require 'libxml'
LoadError: 126: The specified module could not be found.   - D:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0/libxml-ruby-2.9.0/libxml_ruby.so
        from D:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from D:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from D:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/libxml-ruby-2.9.0/lib/libxml.rb:8:in `rescue in <top (required)>'
        from D:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/libxml-ruby-2.9.0/lib/libxml.rb:4:in `<top (required)>'
        from D:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
        from D:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
        from D:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
        from (irb):1
        from D:/Ruby21-x64/bin/irb:11:in `<main>'
irb(main):002:0>

This is even stranger because I've manually verified that the file libxml_ruby.so exists and is correctly installed at the location D:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0/libxml-ruby-2.9.0/libxml_ruby.so, the error message identified above.

Note that I've also tried copying the libxml2.dll (both from the latter and former distribution to various other locations on the run-time path as described by #91 (comment) did not resolve it for me. The other solutions available at http://stackoverflow.com/questions/22417544/having-trouble-installing-libxml-ruby-on-windows/33685307#33685307 did not resolve it either.

Does anybody have any suggestions for how to get this working and/or debug this issue on Windows?

@cfis
Copy link
Member

cfis commented Aug 11, 2016

If you install the binary version of the gem, then no compiling should be happening at all. So that doesn't make a lot of sense.

Try putting the so file in gems/2.1.0/gems/libxml-ruby-2.9.0/lib

@cfis
Copy link
Member

cfis commented Feb 6, 2017

Going to close - reopen if you still need help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants