Git Product home page Git Product logo

Comments (9)

gorn avatar gorn commented on August 9, 2024

There is some info at https://github.com/xml4r/libxml-ruby

gem install x64-mingw32

but is does not work on my windows

from rspreadsheet.

gorn avatar gorn commented on August 9, 2024

Another idea (but not a solution)
xml4r/libxml-ruby#125 suggests gem install libxml-ruby --platform=x64-mingw32, but infortunately it does not work either.

from rspreadsheet.

singpolyma avatar singpolyma commented on August 9, 2024

This problem also exists on Debian, though apt install ruby-libxml fixes it here

from rspreadsheet.

gorn avatar gorn commented on August 9, 2024

on debian, the gem is trying to check whether ruby-libxml is intalled natively and if not, than install it as gem. if that does not work, than it is another issue

from rspreadsheet.

kammerer avatar kammerer commented on August 9, 2024

on debian, the gem is trying to check whether ruby-libxml is intalled natively and if not, than install it as gem. if that does not work, than it is another issue

Sorry for hijacking the issue - it also does not work on Linux Mint 18.2 (Ubuntu based).
Both solutions from this comment solve the problem (downgrade to 0.4.4 or add libxml-ruby to own Gemfile). Tested on rspreadsheet 0.5.3.

from rspreadsheet.

rubycoder avatar rubycoder commented on August 9, 2024

I've also had problems with the libxml gem when trying to use rspreadsheet on Windows (both 7 & 10) with Ruby 2.5.5, even after trying the suggestions above.

I noticed my C:\Ruby\Ruby255-x64\lib\ruby\gems\2.5.0\gems\libxml-ruby-3.0.0-x64-mingw32\lib folder has a 2.4 subfolder containing libxml_ruby.so, but no 2.5 subfolder. As the .so files on Windows are specific to a particular Ruby minor version, this suggests this gem will only work with Ruby 2.4.x.

(Interestingly, C:\Ruby\Ruby255-x64\lib\ruby\gems\2.5.0\gems\libxml-ruby-3.1.0-x64-mingw32\lib does not even have a 2.4 subfolder, so I don't know that libxml-ruby 3.1.0 will work on Windows at all).

The libxml-ruby page on github says "The gem includes prebuilt extensions for Ruby 2.3", suggesting that only specific minor Ruby versions are supported.

I installed Ruby 2.4.9, libxml-ruby 3.0.0, and rspreadsheet 0.5.3 on Windows 7.

libxml_ruby.so has been installed here:
C:\Ruby\Ruby249-x64\lib\ruby\gems\2.4.0\gems\libxml-ruby-3.0.0-x64-mingw32\lib\2.4\libxml_ruby.so
but ruby looks for it here:
C:\Ruby\Ruby249-x64\lib\ruby\gems\2.4.0\gems\libxml-ruby-3.0.0-x64-mingw32\lib\libxml_ruby.so
To fix this, manually copy libxml_ruby.so one level higher in the folder tree.

libxml2-2.dll has been installed here:
C:\Ruby\Ruby249-x64\lib\ruby\gems\2.4.0\gems\libxml-ruby-3.0.0-x64-mingw32\lib\libs\libxml2-2.dll
but ruby looks for it here:
C:\Ruby\Ruby249-x64\bin\libxml2-2.dll
Manually copy libxml2-2.dll to the path above.

Now ruby cannot find liblzma-5.dll.  There isn't a copy in any of my Ruby folders, so I searched my entire hard drive and found a copy here:
C:\Program Files\Git\mingw64\bin\liblzma-5.dll
and manually copied it here:
C:\Ruby\Ruby249-x64\bin\liblzma-5.dll
This file happens to be version 5.2.4.0, 154,319 bytes

After copying these 3 files, rspreadsheet works fine on Windows!

While tracking down these file problems, my test case was to require 'rspreadsheet' in irb. If a .so/.dll wasn't present in the correct subfolder, I'd get output like the following:

I hope this information is helpful to someone.

irb(main):001:0> require 'rspreadsheet'
LoadError: 126: The specified module could not be found.   - C:/Ruby/Ruby249-x64/lib/ruby/gems/2.4.0/gems/libxml-ruby-3.0.0-x64-mingw32/lib/libxml_ruby.so
        from C:/Ruby/Ruby249-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby/Ruby249-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby/Ruby249-x64/lib/ruby/gems/2.4.0/gems/libxml-ruby-3.0.0-x64-mingw32/lib/libxml.rb:8:in `rescue in <top (required)>'
        from C:/Ruby/Ruby249-x64/lib/ruby/gems/2.4.0/gems/libxml-ruby-3.0.0-x64-mingw32/lib/libxml.rb:4:in `<top (required)>'
        from C:/Ruby/Ruby249-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby/Ruby249-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby/Ruby249-x64/lib/ruby/gems/2.4.0/gems/rspreadsheet-0.5.3/lib/rspreadsheet/workbook.rb:2:in `<top (required)>'
        from C:/Ruby/Ruby249-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby/Ruby249-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby/Ruby249-x64/lib/ruby/gems/2.4.0/gems/rspreadsheet-0.5.3/lib/rspreadsheet.rb:2:in `<top (required)>'
        from C:/Ruby/Ruby249-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby/Ruby249-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from (irb):1
        from C:/Ruby/Ruby249-x64/bin/irb.cmd:19:in `<main>'

from rspreadsheet.

doriantaylor avatar doriantaylor commented on August 9, 2024

FYI just installed rspreadsheet on macos catalina and it didn't install libxml-ruby here either.

from rspreadsheet.

Kawsay avatar Kawsay commented on August 9, 2024

Using Debian 10, rspreadsheet 0.5.3, and having ruby-libxml 3.1.0-1 installed, I had to run gem install libxml-ruby to be able to require rspreadsheet.

from rspreadsheet.

soundasleep avatar soundasleep commented on August 9, 2024

I couldn't get rspreadsheet to work under Windows 10/Ruby 3.0.2p107:

C:/Ruby/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/dependencies.rb:332:in `require': cannot load such file -- libxml_ruby (LoadError)

libxml-ruby's suggestion to gem install libxml-ruby-x64-mingw32 doesn't work, I assume because it's built against Ruby 2.7 and I'm on Ruby 3.0 (have raised xml4r/libxml-ruby#176):

C:\path>gem install libxml-ruby-x64-mingw32
ERROR:  Could not find a valid gem 'libxml-ruby-x64-mingw32' (>= 0) in any repository

from rspreadsheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.