Bundler Cheat Sheet

Cheat sheet for Bundler, the Ruby gems package manager.

Cheat sheet with basic commands for Bundler [1], a package manager that provides a consistent environment for Ruby projects by tracking and installing the exact gems (software packages) and versions that are needed.

Installing Gems

Install the dependencies specified in Gemfile

bundle
or
bundle install

Install gems faster

--jobs=[] or -j[] define the maximum number of parallel download and install jobs. The default is 1.

bundle install -j3

Install gems to a local vendor directory

--path specifies a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on the machine.

The command installs dependencies, even gems that are already installed to your system gems, to a location other than your system's gem repository. In this case, to vendor/bundle:

bundle install --path vendor/bundle

Updating Gems

Update gems to latest available versions

The bundle update command [2] will update your gems to the latest available versions. The definition of specific gems (*gems) e.g.jekyll and the --all option are optional.

bundle update
or
bundle update *gems [--all]

Removing Gems

Remove unused Gems

The bundle clean command [3] will remove all unused gems in your bundler directory. This is useful when you have made many changes to your gem dependencies. The --dry-run and --force options are optional.

bundle clean [--dry-run] [--force]

References

  1. Bundler home page
  2. Bundle update
  3. Bundle clean