chr*_*ina 4 ruby-on-rails ruby-on-rails-3
使用这两个命令时,我得到两个不同的结果bundle和bundle update
如果我使用bundle update,我收到以下错误:
Resolving dependencies...
Bundler could not find compatible versions for gem "railties":
In Gemfile:
requirejs-rails (>= 0) ruby depends on
railties (~> 3.1.1) ruby
rails (= 4.0.0.rc2) ruby depends on
railties (4.0.0.rc2)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
requirejs-rails (>= 0) ruby depends on
rails (~> 3.1.1) ruby
rails (4.0.0.rc2)
Run Code Online (Sandbox Code Playgroud)
但如果我只使用bundle,我得到以下内容:
Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
In snapshot (Gemfile.lock):
activesupport (3.2.2)
In Gemfile:
rails (= 4.0.0.rc2) ruby depends on
activesupport (= 4.0.0.rc2) ruby
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Run Code Online (Sandbox Code Playgroud)
这些错误指向两个不同dependencie问题,但两者的命令是fetching gem metadata from https://rubygems.org/...和Resolving dependencies...,因此他们如何不同?
我一直使用bundle,但尝试bundle update并注意到差异.
简而言之:bundle install处理对Gemfile的更改,并捆绑更新升级已由Bundler管理的gem.
http://viget.com/extend/bundler-best-practices
不用说,bundle并且bundle install是相同的命令,install是默认选项bundle.
bundle是相同的bundle install,它执行以下操作:
Gemfile.lock存在.如果是,请安装所有具有指定版本的宝石.Gemfile使用最新的可用/允许版本按照指定安装gems Gemfile.然后创建Gemfile.lock以记录已安装的版本.bundle update另一方面,删除/忽略你的Gemfile.lock,直接进入第二步.
您看到的错误可能是因为某些gem想要active_support在3.x.x版本范围内,而您似乎正在尝试升级到Rails 4.
| 归档时间: |
|
| 查看次数: |
2242 次 |
| 最近记录: |