BUNDLE-UPDATE(1)
π bundle-update(1) β General Commands Manual π
so you opened the manpage, bestie, and it's BUNDLE-UPDATE(1). this is the one about making your gems β¨freshβ¨. let's get into it, no cap.
π NAME π
bundle-update β Update your gems to the latest available versions π
π¦ SYNOPSIS π¦
bundle update *gems [--all] [--group=NAME] [--source=NAME] [--local]
[--ruby] [--bundler[=VERSION]] [--cooldown=NUMBER] [--force]
[--full-index] [--gemfile=GEMFILE] [--jobs=NUMBER] [--quiet]
[--patch|--minor|--major] [--pre] [--strict] [--conservative]
π DESCRIPTION π
okay so here's the tea. bundle update updates the gems you name β or literally all of them if you pass --all β and it does that by ignoring the previously installed gems that are recorded in your Gemfile.lock. π like, it just closes its eyes and pretends that file isn't there.
but ngl, most of the time you do not want that. in general you should be using bundle install(1) bundle-install.1.html to install the same exact gems and the same exact versions across all your machines. that's the whole point β everyone's running the same thing, no surprises, periodt. π
you reach for bundle update when you explicitly want to update the version of a gem. on purpose. deliberately. main character energy. π
β¨ OPTIONS β¨
--allβ Update all gems specified inGemfile. every last one. no crumbs left behind. π₯--group=<list>,-g=<list>β Only update the gems in the group you name. so for instance you can update everything in the development group withbundle update --group development. and you can also dobundle update rails --group testto update therailsgem and all the gems in the test group. two things at once, we love a multitasker. π--source=<list>β the name of a:gitor:pathsource that's used in theGemfile(5). for instance, if your:gitsource ishttp://github.com/rails/rails.git, you'd callbundle update --source rails.--localβ do not even attempt to fetch gems remotely; use the gem cache instead. staying in your lane, offline, cozy. π§--rubyβ update the locked version of Ruby to the current version of Ruby.--bundler[=BUNDLER]β update the locked version of bundler to the bundler version that got invoked.--force,--redownloadβ force reinstalling every gem, even the ones that are already installed. no skips, no shortcuts, no mercy. π€--full-indexβ fall back to using the single-file index of all gems.--gemfile=GEMFILEβ use the gemfile you specify instead of[Gemfile(5)][Gemfile(5)].--jobs=<number>,-j=<number>β how many jobs to run in parallel. the default is the number of available processors. (so basically "go as hard as your CPU physically can" πββοΈπ¨)--retry=[<number>]β retry failed network or git requests that many times.--quietβ only output warnings and errors. silence, but make it chic. π€«--patchβ Prefer updating only to next patch version.--minorβ Prefer updating only to next minor version.--majorβ Prefer updating to next major version (this is the default, bestie).--preβ Always choose the highest allowed version, regardless of prerelease status. we are going for it. π₯--strictβ Do not allow any gem to be updated past latest--patch|--minor|--major.--conservativeβ Usebundle installconservative update behavior, and do not allow indirect dependencies to be updated.--cooldown=<number>β Only consider gem versions published at least number days ago when resolving. pass0to disable cooldown for this run, overriding any per-source or global configuration. combine it with--conservativeto minimize transitive churn when you're bypassing cooldown for an urgent update. seecooldowninbundle-config(1).
π UPDATING ALL GEMS π
if you run bundle update --all, bundler will ignore any previously installed gems and resolve all the dependencies again, based on the latest versions of all the gems available in the sources. full reset. glow-up arc. β¨
consider this Gemfile(5):
source "https://rubygems.org"
gem "rails", "3.0.0.rc"
gem "nokogiri"
when you run bundle install(1) bundle-install.1.html for the first time, bundler will resolve all of the dependencies, alllll the way down, and install what you need:
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Installing builder 2.1.2
Installing abstract 1.0.0
Installing rack 1.2.8
Using bundler 1.7.6
Installing rake 10.4.0
Installing polyglot 0.3.5
Installing mime-types 1.25.1
Installing i18n 0.4.2
Installing mini_portile 0.6.1
Installing tzinfo 0.3.42
Installing rack-mount 0.6.14
Installing rack-test 0.5.7
Installing treetop 1.4.15
Installing thor 0.14.6
Installing activesupport 3.0.0.rc
Installing erubis 2.6.6
Installing activemodel 3.0.0.rc
Installing arel 0.4.0
Installing mail 2.2.20
Installing activeresource 3.0.0.rc
Installing actionpack 3.0.0.rc
Installing activerecord 3.0.0.rc
Installing actionmailer 3.0.0.rc
Installing railties 3.0.0.rc
Installing rails 3.0.0.rc
Installing nokogiri 1.6.5
Bundle complete! 2 Gemfile dependencies, 26 gems total.
Use `bundle show [gemname]` to see where a bundled gem is installed.
as you can see, even though you only 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.lock. so the next time you run bundle install(1) bundle-install.1.html, bundler skips the dependency resolution entirely and installs the same gems it installed last time.
after you check in the Gemfile.lock into version control and clone it on another machine, running bundle install(1) bundle-install.1.html will still install the gems you installed last time. so you don't have to worry that some new release of erubis or mail is gonna quietly change the gems you're using. iconic behavior, honestly. π«Ά
however, from time to time, you might want to update the gems you're using to the newest versions that still match the gems in your Gemfile(5).
to do that, run bundle update --all, which will ignore the Gemfile.lock and resolve all the dependencies again. just 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. π³ so yeah. buckle up.
π UPDATING A LIST OF GEMS π
sometimes you just want to update one single gem in the Gemfile(5) and leave the rest of the gems you specified locked to the versions in the Gemfile.lock. one gem. nothing else. we're being specific today.
for instance, in the scenario above, imagine that nokogiri releases version 1.4.4, and you want to update it without updating Rails and all of its dependencies. to do this, run bundle update nokogiri.
Bundler will update nokogiri and any of its dependencies, but leave Rails and its dependencies alone. boundaries. π
πΈ OVERLAPPING DEPENDENCIES πΈ
sometimes multiple gems declared in your Gemfile(5) are satisfied by the same second-level dependency. messy? a little. consider the case of thin and rack-perftools-profiler.
source "https://rubygems.org"
gem "thin"
gem "rack-perftools-profiler"
the thin gem depends on rack >= 1.0, while rack-perftools-profiler depends on rack ~> 1.0. if you run bundle install, you get:
Fetching source index for https://rubygems.org/
Installing daemons (1.1.0)
Installing eventmachine (0.12.10) with native extensions
Installing open4 (1.0.1)
Installing perftools.rb (0.4.7) with native extensions
Installing rack (1.2.1)
Installing rack-perftools_profiler (0.0.2)
Installing thin (1.2.7) with native extensions
Using bundler (1.0.0.rc.3)
in this case, the two gems have their own set of dependencies, but they share rack in common. so if you run bundle update thin, bundler will update daemons, eventmachine and rack β which are dependencies of thin β but not open4 or perftools.rb, which are dependencies of rack-perftools_profiler. note that bundle update thin will update rack even though it's also a dependency of rack-perftools_profiler. yeah. it does that. π
in short: by default, when you update a gem using bundle update, bundler will update all dependencies of that gem, including the ones that are also dependencies of another gem. it's giving "sharing is caring" whether you asked for it or not.
to prevent updating indirect dependencies, prior to version 1.14 the only option was the CONSERVATIVE UPDATING behavior in bundle install(1) bundle-install.1.html:
in this scenario, updating the thin version manually in the Gemfile(5), and then running bundle install(1) bundle-install.1.html will only update daemons and eventmachine, but not rack. for more information, see the CONSERVATIVE UPDATING section of bundle install(1) bundle-install.1.html.
starting with 1.14, specifying the --conservative option will also prevent indirect dependencies from being updated. π
π₯ PATCH LEVEL OPTIONS π₯
version 1.14 introduced 4 patch-level options that will influence how gem versions are resolved. one of the following options can be used: --patch, --minor or --major. --strict can be added to further influence resolution.
--patch
Prefer updating only to next patch version.
--minor
Prefer updating only to next minor version.
--major
Prefer updating to next major version (default).
--strict
Do not allow any gem to be updated past latest --patch | --minor | --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.g. --patch) changes the sort order of the satisfying versions, causing Bundler to consider the latest --patch or --minor version available before other versions. note that versions outside the stated patch level could still be resolved to if necessary to find a suitable dependency graph. so it's a preference, not a wall. π§±βοΈ
for example, if gem 'foo' is locked at 1.0.2, with no gem requirement defined in the Gemfile, and versions 1.0.3, 1.0.4, 1.1.0, 1.1.1, 2.0.0 all exist, the default order of preference by default (--major) will be "2.0.0, 1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2".
if the --patch option is used, the order of preference will change to "1.0.4, 1.0.3, 1.0.2, 1.1.1, 1.1.0, 2.0.0".
if the --minor option is used, the order of preference will change to "1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2, 2.0.0".
combining the --strict option with any of the patch level options will remove any versions beyond the scope of the patch level option, to ensure that no gem is updated that far. bye bye, big jumps. π
to continue the previous example, if both --patch and --strict options are used, the available versions for resolution would be "1.0.4, 1.0.3, 1.0.2". if --minor and --strict are used, it would be "1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2".
gem requirements as defined in the Gemfile will still be the first determining factor for what versions are available. if the gem requirement for foo in the Gemfile is '~> 1.0', that will accomplish the same thing as providing the --minor and --strict options. β¨
π PATCH LEVEL EXAMPLES β¨
ok so this is the part where it all clicks, bestie. picture this: here are the gem specs we're working with π
foo 1.4.3, requires: ~> bar 2.0
foo 1.4.4, requires: ~> bar 2.0
foo 1.4.5, requires: ~> bar 2.1
foo 1.5.0, requires: ~> bar 2.1
foo 1.5.1, requires: ~> bar 3.0
bar with versions 2.0.3, 2.0.4, 2.1.0, 2.1.1, 3.0.0
and your Gemfile is literally just this, so simple, so pure:
gem 'foo'
and your Gemfile.lock starts out like:
foo (1.4.3)
bar (~> 2.0)
bar (2.0.3)
now the moment you've been waiting for, the cases π
# Command Line Result
------------------------------------------------------------
1 bundle update --patch 'foo 1.4.5', 'bar 2.1.1'
2 bundle update --patch foo 'foo 1.4.5', 'bar 2.1.1'
3 bundle update --minor 'foo 1.5.1', 'bar 3.0.0'
4 bundle update --minor --strict 'foo 1.5.0', 'bar 2.1.1'
5 bundle update --patch --strict 'foo 1.4.4', 'bar 2.0.4'
okay now let me walk you through each one because the why is the whole point π
- in case 1,
bargets upgraded to2.1.1, which is a minor version increase, and it happened because the dependency fromfoo 1.4.5required it. like, it wasn't even trying to be extra, it just had to. - in case 2, only
foois requested to be unlocked, butbaris also allowed to move, because it's not a declared dependency in theGemfile. sneaky little freeloader π - in case 3,
bargoes up a whole major release, because a minor increase is preferred now forfoo, and whenfoogoes to1.5.1, it requires3.0.0ofbar. the ripple effect is real. - in case 4,
foois preferred up to a minor version, but1.5.1won't work because the--strictflag removesbar 3.0.0from consideration since it's a major increment. strict said absolutely not π - in case 5, both
fooandbarhave any minor or major increments removed from consideration because of the--strictflag, so the most they can move is up to1.4.4and2.0.4. tiny steps only, no cap π«Ά
π RECOMMENDED WORKFLOW π¦
okay so generally speaking, when you're working with an application that's managed with bundler, this is the workflow you should be running. it's giving routine. it's giving healthy habits. let's go π
- after you create your
Gemfile(5)for the first time, run
$ bundle install
- check the resulting
Gemfile.lockinto version control
$ git add Gemfile.lock
- when checking out this repository on another development machine, run
$ bundle install
- when checking out this repository on a deployment machine, run
$ bundle install --deployment
- after changing the
Gemfile(5)to reflect a new or update dependency, run
$ bundle install
- make sure to check the updated
Gemfile.lockinto version control
$ git add Gemfile.lock
- if
bundle install(1)bundle-install.1.htmlreports a conflict, manually update the specific gems that you changed in theGemfile(5)
$ bundle update rails thin
- if you want to update all the gems to the latest possible versions that still match the gems listed in the
Gemfile(5), run
$ bundle update --all
and that's the whole page, bestie, you ate it π β¨ this was BUNDLE-UPDATE(1) from April 2026 β go forth and update responsibly, mwah π«ΆππΈ
π¦ where this page comes from
- centos-stream 9: rubygem-bundler 4.0.16-35.module_el9+1443+8853c6a2 Β· MIT AND (Ruby OR BSD-2-Clause)
- fedora 44: rubygem-bundler 4.0.20-39.fc44
- fedora 44: rubygem-bundler 4.0.20-40.fc44 Β· MIT AND (Ruby OR BSD-2-Clause)
- ubuntu stonking: ruby-bundler 4.0.18-1 Β· MIT OR Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms