Getting Started
Guides
Dependency Management
- How to manage application dependencies with Bundler
- How to manage dependencies with Bundler
- How to update gems with Bundler
- How to manage groups of gems
- How to install gems from git repositories
- How to develop multiple gems in one repository
- How to use Bundler with Ruby
- How to use Bundler in a single-file Ruby script
- How to deploy bundled applications
Gem Development
Publishing & Security
- Trusted Publishing
- Setting up multi-factor authentication
- Using multi-factor authentication in command line
- Managing owners using UI
- Organizations
- Removing a Published gem
- Security Practices
- How to delay new gem versions with cooldown
Integrations
- How to use Bundler with Rails
- How to use Bundler with Sinatra
- How to use Bundler with Docker
- How to use Bundler in CI
Hosting & Sources
Extending
Troubleshooting
- Troubleshooting common issues
- How to troubleshoot RubyGems and Bundler TLS/SSL Issues
- How to use git bisect with Bundler
Concepts
- What is a gem?
- Gemfile and gemspec
- Where gems are installed and how they load
- How dependency resolution works
- How Gemfile.lock works
- Versioning and compatibility
- Platforms and native gems
- Caching and vendoring
- Default gems and bundled gems
- Common Vulnerabilities and Exposures
Reference
- gem Command Reference
- Bundler Command Reference
- Gemfile Reference
- Ruby Directive
- Specification Reference
- RubyGems.org API
- RubyGems.org Compact Index API
- RubyGems.org rate limits
- API key scopes
- Bundler compatibility with Ruby
- Configuration (.gemrc)
- Environment variables
- Known Bundler Plugins
Appendix
bundle plugin
This reference was automatically generated from Bundler version 4.1.1.
bundle plugininstall PLUGINS [--source=SOURCE] [--version=VERSION] [--git=GIT] [--branch=BRANCH|--ref=REF] [--path=PATH]
bundle pluginuninstall PLUGINS [--all]
bundle pluginlist
bundle pluginhelp [COMMAND]
Description
You can install, uninstall, and list plugin(s) with this command to extend functionalities of Bundler.
Sub-commands
Install
Install the given plugin(s).
For example, bundle plugin install bundler-graph will install bundler-graph
gem from globally configured sources (defaults to RubyGems.org). Note that the
global source specified in Gemfile is ignored.
OPTIONS
--source=SOURCE- Install the plugin gem from a specific source, rather than from globally configured sources.
Example:
bundle plugin install bundler-graph --source https://example.com --version=VERSION- Specify a version of the plugin gem to install via
--version.Example:
bundle plugin install bundler-graph --version 0.2.1 --git=GIT- Install the plugin gem from a Git repository. You can use standard Git URLs like:
ssh://[user@]host.xz[:port]/path/to/repo.git
http[s]://host.xz[:port]/path/to/repo.git
/path/to/repo
file:///path/to/repoExample:
bundle plugin install bundler-graph --git https://github.com/rubygems/bundler-graph --branch=BRANCH- When you specify
--git, you can use--branchto use. --ref=REF- When you specify
--git, you can use--refto specify any tag, or commit hash (revision) to use. --path=PATH- Install the plugin gem from a local path.
Example:
bundle plugin install bundler-graph --path ../bundler-graph
Uninstall
Uninstall the plugin(s) specified in PLUGINS.
OPTIONS
--all- Uninstall all the installed plugins. If no plugin is installed, then it does nothing.
List
List the installed plugins and available commands.
No options.
Help
Describe subcommands or one specific subcommand.
No options.
Hooks
A plugin can run code at defined points of Bundler's work by registering a
hook. In the plugin's plugins.rb, pass one of the event constants of
Bundler::Plugin::Events and a block to Bundler::Plugin::API.hook. Bundler
loads a plugin that registers a hook for an event when that event fires, and
calls the block with the arguments listed for the event below.
Bundler::Plugin::API.hook Bundler::Plugin::Events::GEM_BEFORE_INSTALL_ALL do |dependencies|
puts "about to install #{dependencies.map(&:name).join(", ")}"
end
The events fire in the order listed here.
GEMFILE EVALUATION
-
GEM_BEFORE_EVAL(before-eval) - Called before the Gemfile is evaluated, with the path to the Gemfile and
the path to the lockfile (
nilwhen there is no lockfile). -
GEM_AFTER_EVAL(after-eval) - Called after the Gemfile is evaluated, with the resulting
Bundler::Definition.
INSTALLATION
-
GEM_BEFORE_INSTALL_ALL(before-install-all) - Called before any gem is installed, with an Array of the
Bundler::Dependencyobjects declared in the Gemfile. -
GEM_BEFORE_FETCH(before-fetch) - Called before each individual gem is downloaded from a remote source, with
a spec-like object responding to the
Gem::SpecificationAPI (for example aBundler::EndpointSpecificationorBundler::RemoteSpecification). Does not fire for a gem that is already present in the download cache. -
GEM_AFTER_FETCH(after-fetch) - Called after each individual gem is downloaded from a remote source, with
the same spec-like object as
GEM_BEFORE_FETCH. Also fires when the download fails. -
GIT_BEFORE_FETCH(before-git-fetch) - Called before a git source is fetched or checked out, with the
Bundler::Source::Gitbeing fetched. -
GIT_AFTER_FETCH(after-git-fetch) - Called after a git source is fetched or checked out, with the same
Bundler::Source::Git. Also fires when the fetch or checkout fails. -
GEM_BEFORE_INSTALL(before-install) - Called before each individual gem is installed, with a
Bundler::ParallelInstaller::SpecInstallation. Itsstate,errorandpost_install_messageare not set yet, as nothing has been installed. -
GEM_AFTER_INSTALL(after-install) - Called after each individual gem is installed, with the same
Bundler::ParallelInstaller::SpecInstallation. If itsstateisfailed,errorholds the exception; if thestateissuccess, apost_install_messagemay be present. -
GEM_AFTER_INSTALL_ALL(after-install-all) - Called after all gems are installed, with an Array of the
Bundler::Dependencyobjects declared in the Gemfile.
REQUIRE
These events fire from Bundler.require.
-
GEM_BEFORE_REQUIRE_ALL(before-require-all) - Called before any gem is required, with an Array of the
Bundler::Dependencyobjects being required. -
GEM_BEFORE_REQUIRE(before-require) - Called before each individual gem is required, with its
Bundler::Dependency. -
GEM_AFTER_REQUIRE(after-require) - Called after each individual gem is required, with its
Bundler::Dependency. -
GEM_AFTER_REQUIRE_ALL(after-require-all) - Called after all gems are required, with an Array of the
Bundler::Dependencyobjects that were required.