BUNDLE-INSTALL(1)
π bundle-install β it's giving "install the deps, bestie" π
(that's BUNDLE-INSTALL(1), General Commands Manual, in case you were wondering which manual page you just opened)
β¨ NAME β¨
bundle-install β Install the dependencies specified in your Gemfile
π¦ SYNOPSIS π¦
bundle install [--cooldown=NUMBER] [--force] [--full-index]
[--gemfile=GEMFILE] [--jobs=NUMBER] [--local] [--lockfile=LOCKFILE]
[--no-cache] [--no-lock] [--prefer-local] [--quiet] [--retry=NUMBER]
[--standalone[=GROUP[ GROUP...]]] [--trust-policy=TRUST-POLICY]
[--target-rbconfig=TARGET-RBCONFIG]
πΈ DESCRIPTION πΈ
Okay so. This installs the gems that live in your Gemfile(5). That's the whole vibe. β¨
If it's your first time running bundle install β and there's no Gemfile.lock yet β Bundler goes out, fetches all your remote sources, resolves the dependencies, and installs every gem you need. Fresh start, main character energy. π
If a Gemfile.lock does exist and you have not touched your Gemfile(5) β Bundler still fetches all the remote sources, but it uses the dependencies listed in the Gemfile.lock instead of resolving them all over again. It already knows what it wants, no cap. π
If a Gemfile.lock does exist and you did update your Gemfile(5) β Bundler uses the deps from the Gemfile.lock for all the gems you didn't update, but it re-resolves the dependencies of the gems you did update. More on this whole update situation below, under CONSERVATIVE UPDATING. iykyk π«Ά
π OPTIONS π
--cooldown=<number>β Only consider gem versions that were published at least number days ago when resolving. Pass0to switch cooldown off for this run, which overrides any per-source or global config. Wanna know how the CLI flag, Bundler config, and Gemfile per-source settings fight it out for precedence? See cooldown inbundle-config(1). π--force,--redownloadβ Force reinstalling every single gem, even the ones already installed. No skipping, no shortcuts. π₯--full-indexβ Bundler will not call Rubygems' API endpoint (which is the default) β instead it downloads and caches a (currently big) index file of all gems. For large bundles that rarely change, turning this on can improve performance. π¦--gemfile=GEMFILEβ Where theGemfile(5)that Bundler should use lives. Defaults to aGemfile(5)in the current working directory. Generally Bundler assumes theGemfile(5)location is also the project root, and it'll go looking forGemfile.lockandvendor/cacherelative to that spot. π--jobs=<number>,-j=<number>β The maximum number of parallel download and install jobs. Default is however many processors you have available. Multitasking slay. β‘--localβ Do not even try to connect torubygems.org. Instead Bundler uses the gems already chillin' in Rubygems' cache or invendor/cache. Heads up though: if an appropriate platform-specific gem exists onrubygems.org, it will not be found. π--lockfile=LOCKFILEβ Where the lockfile Bundler should use lives. Defaults to theGemfilelocation with.lockappended. π--prefer-localβ Force using locally installed gems, or gems already present in Rubygems' cache or invendor/cache, when resolving β even if newer versions exist remotely. It'll only attempt to connect torubygems.orgfor gems that aren't present locally. Local first, always. π--no-cacheβ Do not update the cache invendor/cachewith the newly bundled gems. This doesn't remove any gems already in the cache, it just keeps the newly bundled gems from being cached during the install. π--no-lockβ Do not create a lockfile. Useful if you wanna install dependencies but not lock versions of gems. Recommended for library development, and other situations where the code is expected to work with a range of dependency versions.
This has the same effect as using lockfile false in the Gemfile. See gemfile(5) for more info.
--quietβ Do not print progress information to the standard output. Silence. π€«--retry=[<number>]β Retry failed network or git requests number times. Persistence is iconic. π«Ά--standalone[=<list>]β Makes a bundle that can work without depending on Rubygems or Bundler at runtime. You can specify a space separated list of groups to install. Bundler creates a directory namedbundleand installs the bundle there. It also generates abundle/bundler/setup.rbfile to replace Bundler's own setup in the manner required. π--trust-policy=TRUST-POLICYβ Apply the Rubygems security policy policy, where policy is one ofHighSecurity,MediumSecurity,LowSecurity,AlmostNoSecurity, orNoSecurity. For more details, please see the Rubygems signing documentation linked below in SEE ALSO. π--target-rbconfig=TARGET-RBCONFIGβ Path torbconfig.rbfor the deployment target platform. π―
π DEPLOYMENT MODE π
Bundler's defaults are optimized for development. To switch over to defaults optimized for deployment and for CI, use the deployment setting.
Do not activate deployment mode on development machines β it will cause an error when the Gemfile(5) is modified. π
- A
Gemfile.lockis required.
To make sure the same versions of the gems you developed with and tested with are also the ones used in deployments, a Gemfile.lock is required.
This is mainly to ensure that you remember to check your Gemfile.lock into version control.
- The
Gemfile.lockmust be up to date
In development, you can modify your Gemfile(5) and re-run bundle install to conservatively update your Gemfile.lock snapshot.
In deployment, your Gemfile.lock should be up-to-date with changes made in your Gemfile(5).
- Gems are installed to
vendor/bundle, not your default system location
In development, it's convenient to share the gems used in your application with other applications and other scripts that run on the system.
In deployment, isolation is a more important default. On top of that, the user deploying the application may not have permission to install gems to the system, or the web server may not have permission to read them.
As a result, when deployment is configured, bundle install installs gems to the vendor/bundle directory in the application. This may be overridden using the path setting.
π§ INSTALLING GROUPS π§
By default, bundle install will install all gems in all groups in your Gemfile(5), except those declared for a different platform.
However, you can explicitly tell Bundler to skip installing certain groups with the without setting. This setting takes a space-separated list of groups.
While the without setting will skip installing the gems in the specified groups, bundle install will still download those gems and use them to resolve the dependencies of every gem in your Gemfile(5). π«Ά
This is so that installing a different set of groups on another machine (like, say, a production server) will not change the gems and versions that you have already developed and tested against.
Bundler offers a rock-solid guarantee that the third-party code you are running in development and testing is also the third-party code you are running in production. You can choose to exclude some of that code in different environments, but you will never be caught flat-footed by different versions of third-party code being used in different environments. Periodt. π
For a simple illustration, consider the following Gemfile(5):
source 'https://rubygems.org'
gem 'sinatra'
group :production do
gem 'rack-perftools-profiler'
end
In this case, sinatra depends on any version of Rack (>= 1.0), while rack-perftools-profiler depends on 1.x (~> 1.0).
When you configure bundle config without production in development, we look at the dependencies of rack-perftools-profiler as well. That way, you don't spend all your time developing against Rack 2.0, using new APIs that are unavailable in Rack 1.x, only to have Bundler switch to Rack 1.2 when the production group is used. π
This shouldn't cause any problems in practice, because we do not attempt to install the gems in the excluded groups, and only evaluate them as part of the dependency resolution process.
This also means that you cannot include different versions of the same gem in different groups, because doing so would result in different sets of dependencies used in development and production. Because of the vagaries of the dependency resolution process, this usually affects more than the gems you list in your Gemfile(5), and can (surprisingly) radically change the gems you are using. π
π THE GEMFILE.LOCK π
When you run bundle install, Bundler will persist the full names and versions of all gems that you used (including dependencies of the gems specified in the Gemfile(5)) into a file called Gemfile.lock.
Bundler uses this file in all subsequent calls to bundle install, which guarantees that you always use the same exact code, even as your application moves across machines. π¦
Because of the way dependency resolution works, even a seemingly small change (for instance, an update to a point-release of a dependency of a gem in your Gemfile(5)) can result in radically different gems being needed to satisfy all dependencies.
As a result, you SHOULD check your Gemfile.lock into version control, in both applications and gems. If you do not, every machine that checks out your repository (including your production server) will resolve all dependencies again, which will result in different versions of third-party code being used if any of the gems in the Gemfile(5) or any of their dependencies have been updated. π
When Bundler first shipped, the Gemfile.lock was included in the .gitignore file included with generated gems. Over time, however, it became clear that this practice forces the pain of broken dependencies onto new contributors, while leaving existing contributors potentially unaware of the problem. Since bundle install is usually the first step towards a contribution, the pain of broken dependencies would discourage new contributors from contributing. As a result, we have revised our guidance for gem authors to now recommend checking in the lock for gems. π«Ά
π CONSERVATIVE UPDATING π
okay so bestie, this is the part where bundler is so well-behaved it's honestly giving mature, emotionally intelligent king π
When you make a change to the Gemfile(5) and then run bundle install, Bundler will update only the gems that you modified.
In other words: if a gem you didn't touch was working before you called bundle install, it keeps using the exact same versions of all its dependencies that it used before the update. no chaos, no surprises, no random breakage in prod at 2am πΈ
Let's look at an example, because examples are the moment. Here's your original Gemfile(5):
source 'https://rubygems.org'
gem 'actionpack', '2.3.8'
gem 'activemerchant'
So in this case, both actionpack and activemerchant depend on activesupport. And here's the tea π« β the actionpack gem depends on activesupport 2.3.8 and rack ~> 1.1.0, while the activemerchant gem depends on activesupport >= 2.3.2, braintree >= 2.0.0, and builder >= 2.0.0.
When the dependencies are first resolved, Bundler will select activesupport 2.3.8, because that one satisfies the requirements of both gems in your Gemfile(5). mutual satisfaction, we love to see it β¨
Next, you modify your Gemfile(5) to:
source 'https://rubygems.org'
gem 'actionpack', '3.0.0.rc'
gem 'activemerchant'
Now the actionpack 3.0.0.rc gem has a bunch of new dependencies, and it updates the activesupport dependency to = 3.0.0.rc and the rack dependency to ~> 1.2.1. glow-up but make it complicated π
When you run bundle install, Bundler notices that you changed the actionpack gem, but not the activemerchant gem. So it checks the gems currently being used to satisfy its requirements:
activesupport 2.3.8β also used to satisfy a dependency inactivemerchant, which is not being updatedrack ~> 1.1.0β not currently being used to satisfy another dependency
Because you did not explicitly ask to update activemerchant, you would not expect it to suddenly stop working after updating actionpack. That would be so rude π However β satisfying the new activesupport 3.0.0.rc dependency of actionpack requires updating one of its dependencies.
Even though activemerchant declares a very loose dependency that theoretically matches activesupport 3.0.0.rc, Bundler treats gems in your Gemfile(5) that have not changed as an atomic unit together with their dependencies. Like, they're a friend group. You don't get to invite one to the party without the others π
In this case, the activemerchant dependency is treated as activemerchant 1.7.1 + activesupport 2.3.8, so bundle install will report that it cannot update actionpack.
To explicitly update actionpack, including its dependencies which other gems in the Gemfile(5) still depend on, run bundle update actionpack (see bundle update(1)).
Summary: In general, after making a change to theGemfile(5), you should first try to runbundle install, which will guarantee that no other gem in theGemfile(5)is impacted by the change. If that does not work, runbundle update(1)bundle-update.1.html. π¦
π SEE ALSO π
- Gem install docs β
https://guides.rubygems.org/rubygems-basics/#installing-gems - Rubygems signing docs β
https://guides.rubygems.org/security/
and that's the whole page bestie, we ate and left absolutely no crumbs πβ¨ this one's from April 2026, and it's BUNDLE-INSTALL(1) β go forth and bundle 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