treat
treat copied to clipboard
Unable to install - cannot load such file -- zip/zip (LoadError)
I want to install Treat in my Rails 5.1 - API only app, but I am unable to install 'treat'. After adding in Gemfile, it succeeded in bundle install
.
After that as mentioned in manual, I started IRB to run the commands but it throws me following error -
/home/stldev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in
require': cannot load such file -- zip/zip (LoadError) from /home/stldev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in
block in require' from /home/stldev/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
I am using Roo
gem in the project which also internally uses zip. Is the version used conflicting with treat?
Any help will really be appreciated.
I am facing the same issue on rails gem 'rails', '~> 5.1.4'
Adding the following to the Gemfile
seems to solve the problem:
gem 'rubyzip', '>= 1.0.0' # will load new rubyzip version
gem 'zip-zip' # will load compatibility for old rubyzip API.
Check out the readme for rubyzip
for more details:
https://github.com/rubyzip/rubyzip
That does indeed solve the problem... but shouldn't those dependencies ideally be added to the gem itself, rather than in every app that uses the gem?