axlsx
axlsx copied to clipboard
cannot load such file zip/zip
I just installed axlsx through rubygems. But when I go into irb and try to require 'axlsx' it says cannot load such file zip/zip. Any ideas?
Using Ruby 2.0
Yes, sorry. The current release is not restrictive enough in pinning the version of rubyzip and their latest release has some major changes in code structure. Can I ask you to use master on github while I work on release prep?
To fix it temporally, try adding
gem 'rubyzip', '< 1.0.0'
in your Gemfile.
See rubyzip/rubyzip@652916025a136b84d47326680c244e41686be838
Ah thanks, worked great on master. When will you release to rubygems?
hell or high water, next thursday at the latest.
Why is this closed? I'm having the exact same issue with axlsx 1.3.6.
Ok I reopen it, can someone else confirm that the problem still occurs with latest axlsx?
Still happens
cannot load such file -- zip/zip /gems/axlsx-1.3.6/lib/axlsx.rb:26
rubyzip 1.1.0 axlsx 1.3.6
Still happening here for axlsx 1.3.6.
Pointing to master as a temporary fix.
Still happening here too for axlsx 1.3.6 Cannot use rubyzip < 1.0.0 as some of my other gems have dependencies with rubyzip > 1.0.0
The temporary solution would be to add rubyzip compatibility gem
gem 'zip-zip'
Evaluating Axlsx now. Getting above error for the same reasons as above. I have switched to a fork of master for now, but this is not a good long term solution. What is the delay on offering an actual release with this fix? It makes me nervous using master if it isn't considered release ready.
@kabturek :+1:
I've just released a pre-release version. (v2.1.0.pre) Please test it and report if you have any problems
happens to me as well (v 1.3.6)
Ok I see you are struggling with this issue from years. I have the same problem (v 1.3.6)
I have the same problem 😞.
But with 2.1.0.pre it works.
I have this problem now. Here's from my Gemfile.lock
:
acts_as_xlsx (1.0.6)
activerecord (>= 2.3.9)
axlsx (>= 1.0.13)
i18n (>= 0.4.1)
I have solved it for now with this:
gem 'zip' # Needed by axlsx
gem 'axlsx_rails' # Provide templates for the axlsx gem
Adding: gem 'zip-zip'
worked for me:
From Gemfile.lock
axlsx (1.3.6)
htmlentities (~> 4.3.1)
nokogiri (>= 1.4.1)
rubyzip (>= 0.9.5)
...
zip-zip (0.3)
rubyzip (>= 1.0.0)
Also having this issue. Is v2.1.0 available as an installable gem?
i added on my Gemfile
ruby gem 'zip-zip'
thanks, the problem solved
Getting the same error with axlsx 2.0.1
and roo 2.4.0
on ruby 2.3.3
and rails 4.1.9
.
Bundler could not find compatible versions for gem "rubyzip":
In Gemfile:
axlsx (~> 2.0.1) was resolved to 2.0.1, which depends on
rubyzip (~> 1.0.0)
roo (~> 2.4.0) was resolved to 2.4.0, which depends on
rubyzip (< 2.0.0, ~> 1.1)
Adding gem zip
or gem zip-zip
to Gemfile
doesn't solve the issue.
I tried to update the roo
gem to 2.7.1
and still didn't work.
Removing roo
or axlsx
stops the bundler error.
After some search I tried to update axlsx
to 2.1.0.pre
, but bundler
still kept broken.
The only possible way to make it work here was removing roo
, running bundle install
, adding axlsl 2.1.0.pre
(yeah, only works for 2.1.0.pre
), running bundle install
again and then adding roo
.
In this specific sequence bundler
runs without any issues.
Hope this help someone!
I confirm that the issue is still happening and that @iujisato solution works for me
@iujisato thanks.
This worked for me
gem 'rubyzip', '>= 1.2.1' # axlsx dep
gem 'axlsx', git: 'https://github.com/randym/axlsx.git', ref: '776037c0fc799bb09da8c9ea47980bd3bf296874'
This worked for me
gem 'axlsx_rails'
gem 'zip-zip'
Still a problem with latest version. Including zip-zip works. Can't this be fixed?
2019 and still reporting this problem.
Surely everyone using this gem has their own private fork by now.
+1 here
2020, the baby issue has grown and now speaks for itself