LinuxCommandLibrary

bundler

Manage Ruby application dependencies

TLDR

View documentation for the original command

$ tldr bundle
copy

SYNOPSIS

bundle [-v|--verbose] [-q|--quiet] [--debug] [--config key=value] [--help] [-V|--version] command [args]
e.g., bundle install [--path path] [--without group]

PARAMETERS

-h, --help
    Show help for bundle or subcommand

-v, --verbose
    Enable verbose logging

-q, --quiet
    Suppress output except errors

-V, --version
    Print Bundler version

--no-color
    Disable colored output

-C path, --cd path
    Change working directory before running

--config key=value
    Set temporary config value

--debug
    Enable debug output

--retry num
    Retry network requests num times

--path path
    Install to custom path (subcommand-specific)

DESCRIPTION

Bundler (command: bundle) is a popular Ruby tool for managing application gem dependencies. It prevents 'dependency hell' by locking exact gem versions in a Gemfile.lock file, ensuring consistent environments across development, testing, and production.

Users declare dependencies in a Gemfile, then run bundle install to resolve, download, and install gems. It supports groups (e.g., :development), platforms, git sources, and paths. bundle exec runs commands in the bundled environment, avoiding global gem conflicts.

Key benefits: deterministic builds, faster installs with cached resolutions, deployment safety, and plugin extensibility. Widely used in Rails and Sinatra apps. Install via gem install bundler; not a native Linux binary.

Handles complex resolution with conflict reporting and conservative updates via bundle update. Supports mirrors, credentials, and binstubs for executables.

CAVEATS

Not a core Linux command; requires Ruby (≥2.3). Install with gem install bundler. Gemfile.lock must be committed to version control. Slow on first run due to resolution.

COMMON SUBCOMMANDS

bundle install: Install from Gemfile.lock
bundle update [--conservative]: Update gems
bundle exec <cmd>: Run in bundle env
bundle init: Generate Gemfile
bundle check: Verify setup

GEMFILE BASICS

source 'https://rubygems.org'
gem 'rails'
group :test do
  gem 'rspec'
end
ruby '≥2.7.0'

HISTORY

Created by Carl Lerche in 2009 to solve Ruby dependency issues. Became Ruby standard by 2010. Maintained by Bundler team; v1 (2009), v2 (2018) added parallel installs, faster solver.

SEE ALSO

gem(1), ruby(1), rake(1)

Copied to clipboard