Bundler will update nokogiri and any of its dependencies, but leave alone Rails and its dependencies. Sometimes, multiple gems declared in your Gemfile 5 are satisfied by the same second-level dependency. For instance, consider the case of thin and rack-perftools-profiler. If you run bundle install, you get:.
In this case, the two gems have their own set of dependencies, but they share rack in common. If you run bundle update thin , bundler will update daemons , eventmachine and rack , which are dependencies of thin , but not open4 or perftools. In short, by default, when you update a gem using bundle update , bundler will update all dependencies of that gem, including those that are also dependencies of another gem.
To prevent updating indirect dependencies, prior to version 1. In this scenario, updating the thin version manually in the Gemfile 5 , and then running bundle install 1 will only update daemons and eventmachine , but not rack. Starting with 1. Version 1. One of the following options can be used: --patch , --minor or --major. When Bundler is resolving what versions to use to satisfy declared requirements in the Gemfile or in parent gems, it looks up all available versions, filters out any versions that don't satisfy the requirement, and then, by default, sorts them from newest to oldest, considering them in that order.
Providing one of the patch level options e. Note that versions outside the stated patch level could still be resolved to if necessary to find a suitable dependency graph. For example, if gem 'foo' is locked at 1. If the --patch option is used, the order of preference will change to "1.
In this case, the two gems have their own set of dependencies, but they share rack in common. If you run bundle update thin , bundler will update daemons , eventmachine and rack , which are dependencies of thin , but not open4 or perftools.
In short, when you update a gem using bundle update , bundler will update all dependencies of that gem, including those that are also dependencies of another gem. In this scenario, updating the thin version manually in the Gemfile , and then running bundle install will only update daemons and eventmachine , but not rack. Toggle navigation Bundler. Choose version v2. Options: --local : Do not attempt to fetch gems remotely and use the gem cache instead --source : Update a specific source and all gems associated with it.
Let's assume that the rails 3. However, we didn't specifically ask to update rack-cache , which may not be compatible with rack 1. And while an update from rack 1. In order to avoid this problem, when you update a gem, bundler will not update a dependency of that gem if another gem still depends on it. In this example, since rack-cache still depends on rack , bundler will not update the rack gem.
This ensures that updating rails doesn't inadvertently break rack-cache. Since rails 3. Since you originally declared a dependency on rails 3.
As described above, the bundle install command always does a conservative update, refusing to update gems or their dependencies that you have not explicitly changed in the Gemfile. Installing builder 2. As you can see, even though you have two gems in the Gemfile 5 , your application needs 26 different gems in order to run.
Bundler remembers the exact versions it installed in Gemfile. The next time you run bundle install 1 bundle-install. After checking in the Gemfile. You don't need to worry that a new release of erubis or mail changes the gems you use.
However, from time to time, you might want to update the gems you are using to the newest versions that still match the gems in your Gemfile 5. To do this, run bundle update --all , which will ignore the Gemfile. Keep in mind that this process can result in a significantly different set of the 25 gems, based on the requirements of new gems that the gem authors released since the last time you ran bundle update --all.
For instance, in the scenario above, imagine that nokogiri releases version 1. To do this, run bundle update nokogiri.
0コメント