Comments (9)
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.
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.
This problem also exists on Debian, though apt install ruby-libxml
fixes it here
from rspreadsheet.
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.
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.
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.
FYI just installed rspreadsheet
on macos catalina and it didn't install libxml-ruby
here either.
from rspreadsheet.
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.
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)
- currency field HOT 2
- libxml-ruby dependency not identified by `gem install` on Alpine and Void Linux HOT 5
- FODS support HOT 7
- Setting background color get more cells colorized HOT 13
- Tests failing for ruby >= 2.4.6 HOT 1
- Cells table:covered-table-cell ignored.
- Repeated header rows (contained in table:table-header-rows) are ignored.
- method mispelled: Rspreadsheet::Row#lenght should be #length HOT 1
- Existing formulas do not calculate fields set by rspreadsheet HOT 9
- Header rows are not respected HOT 1
- Rubyzip 1.3.0 and 2.0.0
- rewriting cell addresses in formulas when inserting rows / cells HOT 1
- Size does not ignore formatted cells without content HOT 9
- Randomly crash HOT 1
- Bundler doesn't detect libxml-ruby as a transitive dependency on macOS
- Can we open password protected file HOT 1
- Uncaught exception: cannot load such file -- libxml_ruby even if it's installed. HOT 2
- Problem writing cell with a drop-down list
- Unclear how to set cell number format for date etc.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rspreadsheet.