这是默认Rails应用程序的Gemfile
。
source 'https://rubygems.org'
gem 'rails', '4.1.0'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'tzinfo-data', platforms: [:mingw, :mswin]
我跑bundle install
时,一切都安好了。
现在做
gem install cramp
它的安装也没有任何麻烦。
最后包括
gem 'cramp'
进入Gemfile
。从现在开始,我们有以下结果:
捆绑安装
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
cramp (>= 0) x86-mingw32 depends on
activesupport (= 3.0.pre) x86-mingw32
rails (= 4.1.0) x86-mingw32 depends on
railties (= 4.1.0) x86-mingw32 depends on
activesupport (4.1.0)
捆绑更新
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "thor":
In Gemfile:
cramp (>= 0) x86-mingw32 depends on
thor (~> 0.14.6) x86-mingw32
rails (= 4.1.0) x86-mingw32 depends on
railties (= 4.1.0) x86-mingw32 depends on
thor (0.19.1)
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
cramp (>= 0) x86-mingw32 depends on
activesupport (= 3.0.pre) x86-mingw32
rails (= 4.1.0) x86-mingw32 depends on
activesupport (4.1.0)
我没有指定Cramp版本,因此必须使用与gem install cramp
安装的版本相同的版本。但是为什么gem install
没有任何问题并且bundle install发现了一些未解决的依赖项?
我试图在Windows 7 + Ruby 2.0.0p451 + Rails 4.1.0上完成所有这些工作 以及具有相同Ruby和Rails版本的Ubuntu 12.04 LTS。
我尝试了什么:我在默认bundle install
上运行了bundle update
和Gemfile
,然后又添加了gem 'cramp'
,再次运行bundle install
和bundle update
。结果你可以看到上面几行。
答案 0 :(得分:2)