Skip to content

/config/bundler/bundle-config-path

bundle config set --local path 'vendor/bundle': install gems into the project

The commands on this page have not been executed by our verification runner yet.updated
tool
Bundler
file
.bundle/config (local) or ~/.bundle/config (global); environment variable BUNDLE_PATH
key
path (BUNDLE_PATH)
type
string: a directory, relative to the project root when set locally
default
unset: gems go to the Ruby's system gem directory (GEM_HOME)

bundle config set --local path 'vendor/bundle' tells Bundler to install this project's gems under vendor/bundle instead of the Ruby installation's shared gem directory. Bundler stores it in .bundle/config as BUNDLE_PATH: "vendor/bundle", and every later bundle install and bundle exec in the project uses it. It replaces the deprecated bundle install --path vendor/bundle flag, which saved the same setting implicitly.

Set it

bash
bundle config set --local path 'vendor/bundle'
bundle install
cat .bundle/config

.bundle/config then contains:

.bundle/config
---
BUNDLE_PATH: "vendor/bundle"

Add vendor/bundle to .gitignore. Whether to commit .bundle/config depends on the team; many projects ignore it and set the option in CI instead.

Scopes

CommandStored inApplies to
bundle config set --local path vendor/bundle.bundle/config in the projectThis project
bundle config set --global path ~/.gems~/.bundle/configEvery project of this user
BUNDLE_PATH=vendor/bundle bundle installEnvironment variableThis command only (highest priority)
bundle config get pathnone (reads)Shows the effective value and where it comes from
bundle config unset --local pathRemoves itBack to the system gem directory
SettingEffect
without (BUNDLE_WITHOUT)Skip groups, for example bundle config set --local without "development test"
deployment (BUNDLE_DEPLOYMENT)Require Gemfile.lock, refuse changes, install into vendor/bundle
frozen (BUNDLE_FROZEN)Fail if Gemfile and Gemfile.lock disagree
jobs (BUNDLE_JOBS)Parallel installs, for example 4

Sources