LinuxmacOS

Where Does Bundler Store Gems and Config?

Bundler installs gems per project under vendor/bundle by default, with settings in .bundle/config files.

Last updated

Bundler decides per project where gems go. With bundle config set --local path 'vendor/bundle', everything lands inside the project and travels with it. Without that, gems install into the system gem home shared with every project.

Settings layer the same way: .bundle/config in the project overrides the global ~/.bundle/config. The Gemfile.lock beside the Gemfile pins exact versions, so commit it. Deleting vendor/bundle plus reinstalling from the lockfile rebuilds the environment exactly.

Where Bundler stores this, by platform

Linux
<project>/vendor/bundle and <project>/.bundle/config

Per project gems and settings when path mode is on. Global fallback is the system gem home with ~/.bundle/config. BUNDLE_PATH and BUNDLE_APP_CONFIG env vars override both. Commit Gemfile.lock, never vendor.

macOS
<project>/vendor/bundle and <project>/.bundle/config

Same layout as Linux. rbenv and RVM shims sit in front, so confirm which ruby bundle runs under with which ruby. Per project paths dodge cross version gem conflicts entirely.

Frequently asked questions

Should I commit vendor/bundle to git?

No. Commit the Gemfile and Gemfile.lock, ignore vendor/bundle. A fresh bundle install recreates it exactly from the lockfile. Committing thousands of gem files slows every clone for zero benefit.

Bundler uses the wrong gems. How do I check?

Run bundle config list to see every setting and its source file, and bundle info <gem> for the loaded path. A stale .bundle/config or BUNDLE_PATH env var is the usual culprit when the wrong set loads.

Notice an outdated path? Let us know.