简体   繁体   English

找不到与宝石“ ruby​​zip”兼容的版本

[英]could not find compatible versions for gem “rubyzip”

I am using 我在用

gem 'axlsx_rails' 宝石'axlsx_rails'

gem 'acts_as_xlsx' 宝石'acts_as_xlsx'

for downloading file into excel. 用于将文件下载到excel。 Now I am trying to add the following gem 现在我正在尝试添加以下宝石

gem 'caracal' 宝石'caracal'

for downloading file into docx. 用于将文件下载到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) Bundler找不到与“ ruby​​zip”宝石兼容的版本:在快照中(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) 在Gemfile中:acts_as_xlsx已解析为1.0.6,这取决于axlsx(> = 1.0.13)已解析为2.0.1,其取决于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. 运行bundle update将仅使用Gemfile中的gem从头开始重建快照,这可能会解决冲突。

My gem file looks like following 我的gem文件如下所示

source ' https://rubygems.org ' 来源' https://rubygems.org '

gem 'rails', '4.1.9' gem'rails','4.1.9'

gem 'mysql2', '~> 0.3.19' gem'mysql2','〜> 0.3.19'

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

gem 'uglifier', '>= 1.3.0' gem'uglifier','> = 1.3.0'

gem 'coffee-rails', '~> 4.0.0' 宝石'coffee-rails','〜> 4.0.0'

gem 'jquery-rails' 宝石'jquery-rails'

gem 'jbuilder', '~> 2.0' 宝石'jbuilder','〜> 2.0'

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

gem 'spring', group: :development 宝石'春天',组::发展

gem 'devise' 宝石``设计''

group :development do 小组:发展吗

gem 'better_errors' 宝石'better_errors'

gem 'binding_of_caller' 宝石'binding_of_caller'

gem 'capistrano', '~> 3.4.1' 宝石'capistrano','〜> 3.4.1'

gem 'capistrano-rails' 宝石'capistrano-rails'

gem 'capistrano-bundler' 宝石'capistrano-bundler'

gem 'capistrano-rvm' 宝石'capistrano-rvm'

end 结束

gem 'therubyracer' 宝石'therubyracer'

gem 'less-rails' 宝石“ less-rails”

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

gem 'cancan' 宝石'cancan'

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

gem 'rmagick' 宝石'rmagick'

gem 'caracal' 宝石'caracal'

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

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

gem 'wicked' 宝石'邪恶'

gem 'figaro' 宝石“ figaro”

gem 'bootstrap-datepicker-rails' gem'bootstrap-datepicker-rails'

gem 'axlsx_rails' 宝石'axlsx_rails'

gem 'acts_as_xlsx' 宝石'acts_as_xlsx'

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 . axlsx_rails宝石尚未更新相当长一段时间,它依赖于一个版本的axlsx取决于宝石1.0.x的版本rubyzip Whereas caracal depends on a version >= 1.1 . caracal取决于>= 1.1的版本。 That said: Current versions of that gem will not work together. 就是说:该gem的当前版本无法一起使用。

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 . 但是axlsx 1.3.6的甚至更旧的版本对rubyzip gem的依赖性更宽松-它仅要求其版本>= 0.9.5

Therefore I suggest - if possible - to downgrade axlsx_rails to 0.1.2 and try again: 因此,我建议(如果可能)将axlsx_rails降级为0.1.2然后重试:

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

And run bundle install again. 并再次运行bundle install

I have solved the problem by adding 我已经通过添加解决了问题

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

in the gem file. 在gem文件中。 This gives an error first then I had to update rubyzip. 这首先给一个错误,然后我不得不更新rubyzip。 After that I run 之后,我跑步

bundle install 捆绑安装

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM