Install gems with Bundler
Links:
- Ruby: ruby-lang.org
- Bundler: bundler.io
- Navigate to your project root.
- Configure Bundler for your project (this will create
.bundle/config
).$ bundle config set --local path vendor/bundle
- Install dependencies from
Gemfile
.$ bundle install
Notes
Bundler only needs to be configured once. You'll get a config like this:
.bundle/config
--- BUNDLE_PATH: "vendor/bundle"
Now, all installs with bundle install
will be scoped to the project's vendor/
directory. That must added to your .gitignore
file.
The order of the command is important - you'll get a bad result if you move --local
to before set
. If the config command fails, remove the set
argument or upgrade to Bundler 2._
There was previously a flow like this, but this is deprecated. Rather to config and install in two lines.
$ bundle install --path vendor/bundle