BUNDLE-LOCK(1)
π BUNDLE-LOCK π
okay bestie, so bundle-lock lives in the General Commands Manual section (section 1, the classics), and it's here to Creates / Updates a lockfile without installing. yep that's the whole name line, we're keeping it, it's iconic.
β¨ SYNOPSIS β¨
bundle lock [--update] [--bundler[=BUNDLER]] [--local] [--print]
[--lockfile=PATH] [--full-index] [--gemfile=GEMFILE] [--add-checksums]
[--add-platform] [--remove-platform] [--normalize-platforms] [--patch]
[--minor] [--major] [--pre] [--strict] [--conservative]
[--cooldown=NUMBER]
like. look at her. that's a LOT of flags and she's serving every single one π«Ά
πΈ DESCRIPTION πΈ
Lock the gems specified in Gemfile.
that's it. that's the description. short queen. no notes. π
π OPTIONS π
strap in, there's 18 of them and each one is doing the absolute most.
--update[=<list>]β bestie this one IGNORES the lockfile that already exists π like, completely disregards her. it resolves and then updates the lockfile. you can hand it a list of gems, or if you don't give it a list it updates all the gems. main character energy fr.--bundler[=BUNDLER]β updates the locked version of bundler to the version you give it, or to the latest version if you didn't give one. she'll just go grab the newest one herself π--localβ do NOT attempt to connect to rubygems.org, periodt. instead, Bundler uses the gems that are already chilling in Rubygems' cache or invendor/cache. β οΈ heads up though: if an appropriate platform-specific gem exists on rubygems.org, it will not be found. so like, that gem is just not coming to the party.--printβ prints the lockfile toSTDOUTinstead of writing it to the file system. look at her, no commitment, just vibes π¦--lockfile=LOCKFILEβ the path where the lockfile should be written to. tell her where to put it.--full-indexβ falls back to using the single-file index of all gems.--gemfile=GEMFILEβ use the specified gemfile instead of [Gemfile(5)][Gemfile(5)]. so specific, love that for us.--add-checksumsβ adds checksums to the lockfile. security girlie π--add-platform=<list>β adds a new platform to the lockfile, and re-resolves for the addition of that platform. she's thorough.--remove-platform=<list>β removes a platform from the lockfile. bye bitch π--normalize-platformsβ normalizes lockfile platforms. β¨ clean β¨--patchβ if updating, prefers updating only to the next patch version.--minorβ if updating, prefers updating only to the next minor version.--majorβ if updating, prefers updating to the next major version (this one is the default, so it's the unbothered fave).--preβ if updating, ALWAYS chooses the highest allowed version, no matter what the prerelease status is. she's chaotic. she's fearless. she's picking the pre version.--strictβ if updating, does NOT allow any gem to be updated past the latest--patch|--minor|--major. no sneaking past the line, bestie.--conservativeβ if updating, usesbundle installconservative update behavior and does not allow shared dependencies to be updated. very "we're not touching your stuff" of her.--cooldown=<number>β only considers gem versions published at least number days ago when resolving. pass0to disable cooldown for this run, which overrides any per-source or global configuration. see cooldown inbundle-config(1). it's giving "let it marinate" π
π₯ UPDATING ALL GEMS π₯
If you run bundle lock with the --update option and without a list of gems, bundler will ignore any previously installed gems and resolve all dependencies again, based on the latest versions of all gems available in the sources.
like. everything. all of it. fresh start. no cap. π
π§ UPDATING A LIST OF GEMS π§
Sometimes you want to update, like, ONE gem in the Gemfile(5) and leave the rest of the gems you specified locked to the versions in the Gemfile.lock. relatable honestly.
For instance, you only want to update nokogiri, so you run:
bundle lock --update nokogiri
Bundler will update nokogiri and any of its dependencies, but leave the rest of the gems that you specified locked to the versions in the Gemfile.lock.
only nokogiri gets the glow up. everyone else stays exactly where they are. obsessed π
π SUPPORTING OTHER PLATFORMS π
If you want your bundle to support platforms other than the one you're running locally, you can run:
bundle lock --add-platform PLATFORM
which adds PLATFORM to the lockfile, forces bundler to re-resolve and consider the new platform when picking gems β all without needing to have a machine that matches PLATFORM handy to install those platform-specific gems on. the way that works is genuinely so convenient, I'm not even joking πβ¨
For a full explanation of gem platforms, see gem help platform.
β PATCH LEVEL OPTIONS β
See bundle update(1) bundle-update.1.html for details. go read that one, bestie, she's got the lore π
okay and one last thing before you go β this whole page is from April 2026, so yeah, she's fresh, she's current, she's got the vibe check passed. love that for her ππ β¨
π¦ where this page comes from
- 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