gpt4 book ai didi

ruby-on-rails - bundle 和 bundle 更新有什么区别?

转载 作者:行者123 更新时间:2023-12-03 00:39:02 25 4
gpt4 key购买 nike

使用两个命令 bundlebundle 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)

但是如果我只使用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.

这些错误指向两个不同的依赖关系问题,但这两个命令都是从 https://rubygems.org/获取 gem 元数据...解决依赖关系...,那么它们有什么不同呢?

我一直只使用bundle,但尝试bundle update并注意到了差异。

最佳答案

In a nutshell: bundle install handles changes to the Gemfile and bundle update upgrades gems that are already managed by Bundler.

http://viget.com/extend/bundler-best-practices

不用说,bundlebundle install 是同一个命令,installbundle 的默认选项>.

关于ruby-on-rails - bundle 和 bundle 更新有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17174878/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com