bundle update 是否安装之前未安装的 gem

Does bundle update install gems that haven't been installed before

这只是一个关于 bundle installbundle update 的一般性问题,它就像标题一样简单。 bundle update 是否对事先未安装的文件执行 bundle install

Bundle Update 实际上会更新您捆绑的 gem 的版本,请参阅:http://bundler.io/man/bundle-update.1.html#NAME

而 Bundle Install 将安装以前未安装的缺失 gem,请参阅:http://bundler.io/v1.13/man/bundle-install.1.html#NAME

简而言之,是的。

bundle update 将安装您的 gem 文件中列出的所有 gem 的最新版本,无论您在 Gemfile.lock 中有什么。例如。如果您要将 rails 添加到您的 Gemfile 之前没有 运行 bundle install 捆绑包更新将安装 rails gem.

To do this, run bundle update, which will ignore the Gemfile.lock, and resolve all the dependencies again

source

运行ning bundle update 做了两件事:

  1. Gemfile.lock 更新到可用的最新版本,使用 Gemfile 作为更新 Gemfile.lock.

    [=28= 的信息源]
  2. 运行 bundle install 以确保所有这些 gem 都存在于您的系统中。

所以是的,如果您将 gem 添加到 Gemfile,然后添加 运行 bundle update,它也会为您安装这个新的 gem。