bundler
Manage Ruby application dependencies
TLDR
View documentation for the original command
SYNOPSIS
bundle command [options]
PARAMETERS
install
Installs the gems specified in the Gemfile.
update
Updates the gems specified in the Gemfile to the latest versions allowed by the version constraints.
exec
Executes a command in the context of the bundle.
show
Shows the path to a gem installed by Bundler.
outdated
Lists the gems that have newer versions available.
config
Sets or displays Bundler configuration options.
cache
Caches all the gems required to run the application into the vendor/cache directory
check
Checks if the dependencies listed in Gemfile are satisfied by currently installed gems.
DESCRIPTION
Bundler provides a consistent environment for Ruby projects by managing gem dependencies. It ensures that an application runs with the exact gem versions specified in its `Gemfile`, preventing conflicts and dependency hell. Bundler achieves this by creating a reproducible environment, installing the necessary gems, and making them available to the application. It centralizes gem management, making it easier to share and deploy Ruby projects.
Bundler simplifies project setup, ensuring all developers and deployment environments use the same gem versions. The `Gemfile` defines the project's dependencies, and Bundler uses this file to resolve and install the required gems. This approach eliminates guesswork and ensures a consistent and reliable environment for Ruby applications.
CAVEATS
Bundler relies on a `Gemfile` and `Gemfile.lock` file for dependency management. Ensure these files are properly maintained and committed to your version control system.
Modifying `Gemfile` can trigger gem version conflicts or require significant updates, so proceed with caution when changing dependencies.
Using system gems instead of Bundler managed gems is generally discouraged.
GEMFILE
The Gemfile is the heart of Bundler. It specifies the gem dependencies for your Ruby project.
You can declare gem names, versions, and sources within the Gemfile. Bundle then uses this information to manage the project's gems.
Example:
`gem 'rails', '~> 6.0'`
GEMFILE.LOCK
The Gemfile.lock file records the exact versions of gems that are installed in your project.
It ensures that everyone working on the project uses the same gem versions, preventing inconsistencies.
This file should always be committed to version control.
HISTORY
Bundler was created to solve the problems of dependency management in Ruby projects. Before Bundler, managing gem dependencies was a manual and error-prone process, often leading to conflicts and versioning issues.
Bundler's development was driven by the need for a reliable and reproducible way to manage dependencies, ensuring that applications would run consistently across different environments. It quickly gained popularity within the Ruby community and became the standard dependency manager for Ruby projects.