/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
bundle config set --local path 'vendor/bundle'
bundle install
cat .bundle/config.bundle/config then contains:
---
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
| Command | Stored in | Applies to |
|---|---|---|
| bundle config set --local path vendor/bundle | .bundle/config in the project | This project |
| bundle config set --global path ~/.gems | ~/.bundle/config | Every project of this user |
| BUNDLE_PATH=vendor/bundle bundle install | Environment variable | This command only (highest priority) |
| bundle config get path | none (reads) | Shows the effective value and where it comes from |
| bundle config unset --local path | Removes it | Back to the system gem directory |
Related settings used with it
| Setting | Effect |
|---|---|
| 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
Related pages
commands · bundlerbundle exec: run a command with the Gemfile's gem versionsbundle exec CMD runs a command with exactly the gem versions in Gemfile.lock, avoiding conflicts with other installed versions. When you need it, and binstubs.errors · bundlerBundler: Could not find rake-13.2.1 in locally installed gemsCould not find GEM-VERSION in locally installed gems: Gemfile.lock lists a gem not installed for this Ruby. Run bundle install; check path and platforms.compare · bundlerbundle install vs bundle update: differences and when to use eachbundle install installs the versions in Gemfile.lock and resolves new gems only; bundle update upgrades them. Use install daily, update GEM to upgrade.