jisan
jisan

Reputation: 33

could not find compatible versions for gem "rubyzip"

I am using

gem 'axlsx_rails'

gem 'acts_as_xlsx'

for downloading file into excel. Now I am trying to add the following gem

gem 'caracal'

for downloading file into docx. Whenever, I am trying to run

bundle install, I got the following error

Bundler could not find compatible versions for gem "rubyzip": In snapshot (Gemfile.lock): rubyzip (= 1.0.0)

In Gemfile: acts_as_xlsx was resolved to 1.0.6, which depends on axlsx (>= 1.0.13) was resolved to 2.0.1, which depends on rubyzip (~> 1.0.0)

caracal was resolved to 0.1.0, which depends on
  rubyzip (~> 1.1)

Running bundle update will rebuild your snapshot from scratch, using only the gems in your Gemfile, which may resolve the conflict.

My gem file looks like following

source 'https://rubygems.org'

gem 'rails', '4.1.9'

gem 'mysql2', '~> 0.3.19'

gem 'sass-rails', '~> 4.0.3'

gem 'uglifier', '>= 1.3.0'

gem 'coffee-rails', '~> 4.0.0'

gem 'jquery-rails'

gem 'jbuilder', '~> 2.0'

gem 'sdoc', '~> 0.4.0', group: :doc

gem 'spring', group: :development

gem 'devise'

group :development do

gem 'better_errors'

gem 'binding_of_caller'

gem 'capistrano', '~> 3.4.1'

gem 'capistrano-rails'

gem 'capistrano-bundler'

gem 'capistrano-rvm'

end

gem 'therubyracer'

gem 'less-rails'

gem 'twitter-bootstrap-rails', '3.2.0'

gem 'cancan'

gem 'carrierwave', github: 'carrierwaveuploader/carrierwave'

gem 'rmagick'

gem 'caracal'

gem 'activerecord-session_store', github: 'rails/activerecord-session_store'

gem 'carmen-rails', '~> 1.0.0'

gem 'wicked'

gem 'figaro'

gem 'bootstrap-datepicker-rails'

gem 'axlsx_rails'

gem 'acts_as_xlsx'

Upvotes: 0

Views: 2563

Answers (2)

jisan
jisan

Reputation: 33

I have solved the problem by adding

gem 'axlsx', '~> 2.1.0.pre'

in the gem file. This gives an error first then I had to update rubyzip. After that I run

bundle install

Upvotes: 1

spickermann
spickermann

Reputation: 106802

The axlsx_rails gem hasn't been updated for quite a while and it depends on a version of the axlsx gem that depends on a 1.0.x version of the rubyzip. Whereas caracal depends on a version >= 1.1. That said: Current versions of that gem will not work together.

But an even older version of the axlsx 1.3.6 had a more relaxed dependency to the rubyzip gem - it only requires its version to be >= 0.9.5.

Therefore I suggest - if possible - to downgrade axlsx_rails to 0.1.2 and try again:

# add a version to the axlsx_rails gem in your Gemfile
gem 'axlsx_rails', '0.1.2'

And run bundle install again.

Upvotes: 0

Related Questions