Gem-rails和rspec-rails之间的gem依赖冲突 [英] Gem dependency conflict between coffee-rails and rspec-rails
问题描述
我将应用程式从rails 3.1.1升级到rails 3.2。我不得不更新版本的咖啡rails,以及rspec-rails到最新版本,以使用rails 3.2。然而,它们似乎彼此不兼容。当我运行捆绑我得到
在Gemfile:
coffee-rails(〜> 3.2.2)ruby取决于
actionpack(= 3.2.0)ruby
rspec-rails(〜> 2.8.1)ruby取决于
actionpack(3.0.0)
nofollow> rubygems for rspec-rails ,它明确指定了依赖关系> = actionpack(3.0.0)
以前有人遇到过吗?
解决方案我最近刚刚在Gemifile新的Rails 3.2应用程序的资产组:
group:assets do
gem'sass-rails' 〜> 3.2.3'
gem'coffee-rails','〜> 3.2.1'
#查看https://github.com/sstephenson/execjs#readme更多支持的运行时
#gem'therubyracer'
gem' uglifier','> = 1.0.3'
end
的操作,但你可以删除您当前的Gemfile.lock并捆绑应用程序作为一个新的。它在理论上听起来很脏,但它在实践中工作正常。你总是可以看到与git diff的差异,假设你使用它。
I'm upgrading an app from rails 3.1.1 to rails 3.2. I had to update version of coffee-rails as well as rspec-rails to their latest versions to work with rails 3.2. However, they both seem to be incompatible with each other. When I run the bunder I get
In Gemfile:
coffee-rails (~> 3.2.2) ruby depends on
actionpack (= 3.2.0) ruby
rspec-rails (~> 2.8.1) ruby depends on
actionpack (3.0.0)
However, on rubygems for rspec-rails, it clearly specifies the dependency to be >= actionpack (3.0.0)
Has anybody faced this before?
解决方案 I've done this recently just pasting in the Gemifile the asset group from a fresh new Rails 3.2 application:
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
It's not a perfect way of doing it but you can remove your current Gemfile.lock and bundle the app as a new one. It sounds dirty in theory but it works just fine in practice. You can always see the differences with a git diff, supposing you're using it.
这篇关于Gem-rails和rspec-rails之间的gem依赖冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!