Skip to content

Instantly share code, notes, and snippets.

@MichaelCurrin
Last active September 17, 2020 11:04
Show Gist options
  • Save MichaelCurrin/5c8c45a86bcf53d7b49a7763c02943b1 to your computer and use it in GitHub Desktop.
Save MichaelCurrin/5c8c45a86bcf53d7b49a7763c02943b1 to your computer and use it in GitHub Desktop.
Install gems with Bundler

Install gems with Bundler

Links:

  1. Navigate to your project root.
  2. Configure Bundler for your project (this will create .bundle/config).
    $ bundle config set --local path vendor/bundle
  3. 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 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment