louismullie / treat

Natural language processing framework for Ruby.
Other
1.37k stars 128 forks source link

Unable to install - cannot load such file -- zip/zip (LoadError) #125

Open Disha-Shah opened 7 years ago

Disha-Shah commented 7 years ago

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:inblock 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.

an-nasir commented 6 years ago

I am facing the same issue on rails gem 'rails', '~> 5.1.4'

andreaslillebo commented 6 years ago

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

drusepth commented 5 years ago

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?