[rubygems/rubygems] Complete remembered options removal

https://github.com/rubygems/rubygems/commit/573ffad3ea
This commit is contained in:
David Rodríguez 2025-09-09 14:37:09 +02:00 committed by Hiroshi SHIBATA
parent 881b585513
commit ecd1284bf2
59 changed files with 184 additions and 1065 deletions

View File

@ -173,7 +173,7 @@ module Bundler
D
method_option "dry-run", type: :boolean, default: false, banner: "Lock the Gemfile"
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
method_option "path", type: :string, banner: "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
method_option "path", type: :string, banner: "Specify a different path than the system default, namely, $BUNDLE_PATH or $GEM_HOME (removed)"
def check
remembered_flag_deprecation("path")
@ -211,9 +211,9 @@ module Bundler
If the bundle has already been installed, bundler will tell you so and then exit.
D
method_option "binstubs", type: :string, lazy_default: "bin", banner: "Generate bin stubs for bundled gems to ./bin"
method_option "clean", type: :boolean, banner: "Run bundle clean automatically after install"
method_option "deployment", type: :boolean, banner: "Install using defaults tuned for deployment environments"
method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this install"
method_option "clean", type: :boolean, banner: "Run bundle clean automatically after install (removed)"
method_option "deployment", type: :boolean, banner: "Install using defaults tuned for deployment environments (removed)"
method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this install (removed)"
method_option "full-index", type: :boolean, banner: "Fall back to using the single-file index of all gems"
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
@ -221,16 +221,16 @@ module Bundler
method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
method_option "path", type: :string, banner: "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache (removed)."
method_option "path", type: :string, banner: "Specify a different path than the system default, namely, $BUNDLE_PATH or $GEM_HOME (removed)."
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default (usually 'ruby')"
method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default, usually 'ruby' (removed)"
method_option "standalone", type: :array, lazy_default: [], banner: "Make a bundle that can work without the Bundler runtime"
method_option "system", type: :boolean, banner: "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
method_option "system", type: :boolean, banner: "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application (removed)"
method_option "trust-policy", alias: "P", type: :string, banner: "Gem trust policy (like gem install -P). Must be one of #{Bundler.rubygems.security_policy_keys.join("|")}"
method_option "target-rbconfig", type: :string, banner: "Path to rbconfig.rb for the deployment target platform"
method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group."
method_option "with", type: :array, banner: "Include gems that are part of the specified named group."
method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group (removed)."
method_option "with", type: :array, banner: "Include gems that are part of the specified named group (removed)."
def install
%w[clean deployment frozen no-prune path shebang without with].each do |option|
remembered_flag_deprecation(option)
@ -323,7 +323,7 @@ module Bundler
will create binstubs for all given gems.
D
method_option "force", type: :boolean, default: false, banner: "Overwrite existing binstubs if they exist"
method_option "path", type: :string, lazy_default: "bin", banner: "Binstub destination directory (default bin)"
method_option "path", type: :string, lazy_default: "bin", banner: "Binstub destination directory, `bin` by default (removed)"
method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default (usually 'ruby')"
method_option "standalone", type: :boolean, banner: "Make binstubs that can work without the Bundler runtime"
method_option "all", type: :boolean, banner: "Install binstubs for all gems"
@ -396,15 +396,15 @@ module Bundler
end
desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
method_option "all", type: :boolean, default: Bundler.feature_flag.cache_all?, banner: "Include all sources (including path and git)."
method_option "all", type: :boolean, default: Bundler.settings[:cache_all], banner: "Include all sources (including path and git) (removed)."
method_option "all-platforms", type: :boolean, banner: "Include gems for all platforms present in the lockfile, not only the current one"
method_option "cache-path", type: :string, banner: "Specify a different cache path than the default (vendor/cache)."
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
method_option "no-install", type: :boolean, banner: "Don't install the gems, only update the cache."
method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
method_option "path", type: :string, banner: "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache (removed)."
method_option "path", type: :string, banner: "Specify a different path than the system default, namely, $BUNDLE_PATH or $GEM_HOME (removed)."
method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install"
method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install (removed)"
long_desc <<-D
The cache command will copy the .gem files for every gem in the bundle into the
directory ./vendor/cache. If you then check that directory into your source
@ -420,17 +420,12 @@ module Bundler
end
if flag_passed?("--path")
message =
"The `--path` flag is deprecated because its semantics are unclear. " \
"Use `bundle config cache_path` to configure the path of your cache of gems, " \
"and `bundle config path` to configure the path where your gems are installed, " \
"and stop using this flag"
removed_message =
"The `--path` flag has been removed because its semantics were unclear. " \
"Use `bundle config cache_path` to configure the path of your cache of gems, " \
"and `bundle config path` to configure the path where your gems are installed, " \
"and stop using this flag"
SharedHelpers.major_deprecation 2, message, removed_message: removed_message
raise InvalidOption, removed_message
end
require_relative "cli/cache"
@ -750,17 +745,12 @@ module Bundler
end
def print_remembered_flag_deprecation(flag_name, option_name, option_value)
message =
"The `#{flag_name}` flag is deprecated because it relies on being " \
"remembered across bundler invocations, which bundler will no longer " \
"do in future versions. Instead please use `bundle config set #{option_name} " \
"#{option_value}`, and stop using this flag"
removed_message =
"The `#{flag_name}` flag has been removed because it relied on being " \
"remembered across bundler invocations, which bundler no longer does. " \
"Instead please use `bundle config set #{option_name} #{option_value}`, " \
"and stop using this flag"
Bundler::SharedHelpers.major_deprecation 2, message, removed_message: removed_message
raise InvalidOption, removed_message
end
def flag_passed?(name)

View File

@ -10,16 +10,12 @@ module Bundler
def run
Bundler.ui.level = "warn" if options[:quiet]
Bundler.settings.set_command_option_if_given :path, options[:path]
Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
setup_cache_all
install
custom_path = Bundler.settings[:path] if options[:path]
Bundler.settings.temporary(cache_all_platforms: options["all-platforms"]) do
Bundler.load.cache(custom_path)
Bundler.load.cache
end
end
@ -32,11 +28,5 @@ module Bundler
options["no-cache"] = true
Bundler::CLI::Install.new(options).run
end
def setup_cache_all
all = options.fetch(:all, Bundler.feature_flag.cache_all? || nil)
Bundler.settings.set_command_option_if_given :cache_all, all
end
end
end

View File

@ -20,36 +20,18 @@ module Bundler
Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Gem.freebsd_platform?
# Disable color in deployment mode
Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
if target_rbconfig_path = options[:"target-rbconfig"]
Bundler.rubygems.set_target_rbconfig(target_rbconfig_path)
end
check_for_options_conflicts
check_trust_policy
if options[:deployment] || options[:frozen] || Bundler.frozen_bundle?
unless Bundler.default_lockfile.exist?
flag = "--deployment flag" if options[:deployment]
flag ||= "--frozen flag" if options[:frozen]
flag ||= "deployment setting" if Bundler.settings[:deployment]
flag ||= "frozen setting" if Bundler.settings[:frozen]
raise ProductionError, "The #{flag} requires a lockfile. Please make " \
"sure you have checked your #{SharedHelpers.relative_lockfile_path} into version control " \
"before deploying."
end
Bundler.settings.set_command_option :deployment, true if options[:deployment]
Bundler.settings.set_command_option :frozen, true if options[:frozen]
end
# When install is called with --no-deployment, disable deployment mode
if options[:deployment] == false
Bundler.settings.set_command_option :frozen, nil
options[:system] = true
if Bundler.frozen_bundle? && !Bundler.default_lockfile.exist?
flag = "deployment setting" if Bundler.settings[:deployment]
flag = "frozen setting" if Bundler.settings[:frozen]
raise ProductionError, "The #{flag} requires a lockfile. Please make " \
"sure you have checked your #{SharedHelpers.relative_lockfile_path} into version control " \
"before deploying."
end
normalize_settings
@ -118,22 +100,6 @@ module Bundler
"#{count} #{count == 1 ? "gem" : "gems"} now installed"
end
def check_for_group_conflicts_in_cli_options
conflicting_groups = Array(options[:without]) & Array(options[:with])
return if conflicting_groups.empty?
raise InvalidOption, "You can't list a group in both with and without." \
" The offending groups are: #{conflicting_groups.join(", ")}."
end
def check_for_options_conflicts
if (options[:path] || options[:deployment]) && options[:system]
error_message = String.new
error_message << "You have specified both --path as well as --system. Please choose only one option.\n" if options[:path]
error_message << "You have specified both --deployment as well as --system. Please choose only one option.\n" if options[:deployment]
raise InvalidOption.new(error_message)
end
end
def check_trust_policy
trust_policy = options["trust-policy"]
unless Bundler.rubygems.security_policies.keys.unshift(nil).include?(trust_policy)
@ -143,28 +109,11 @@ module Bundler
Bundler.settings.set_command_option_if_given :"trust-policy", trust_policy
end
def normalize_groups
check_for_group_conflicts_in_cli_options
# need to nil them out first to get around validation for backwards compatibility
Bundler.settings.set_command_option :without, nil
Bundler.settings.set_command_option :with, nil
Bundler.settings.set_command_option :without, options[:without]
Bundler.settings.set_command_option :with, options[:with]
end
def normalize_settings
Bundler.settings.set_command_option :path, nil if options[:system]
Bundler.settings.set_command_option_if_given :path, options[:path]
if options["standalone"] && Bundler.settings[:path].nil? && !options["local"]
Bundler.settings.set_command_option :path, "bundle"
end
bin_option = options["binstubs"]
bin_option = nil if bin_option&.empty?
Bundler.settings.set_command_option :bin, bin_option if options["binstubs"]
Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
Bundler.settings.set_command_option_if_given :jobs, options["jobs"]
@ -175,8 +124,6 @@ module Bundler
Bundler.settings.set_command_option_if_given :clean, options["clean"]
normalize_groups if options[:without] || options[:with]
options[:force] = options[:redownload] if options[:redownload]
end

View File

@ -60,28 +60,6 @@ module Bundler
end
end
# needed for binstubs
def executables
if @remote_specification
@remote_specification.executables
elsif _local_specification
_local_specification.executables
else
super
end
end
# needed for bundle clean
def bindir
if @remote_specification
@remote_specification.bindir
elsif _local_specification
_local_specification.bindir
else
super
end
end
# needed for post_install_messages during install
def post_install_message
if @remote_specification

View File

@ -29,7 +29,6 @@ module Bundler
settings_flag(:allow_offline_install) { bundler_4_mode? }
settings_flag(:cache_all) { bundler_4_mode? }
settings_flag(:forget_cli_options) { bundler_4_mode? }
settings_flag(:global_gem_cache) { bundler_5_mode? }
settings_flag(:lockfile_checksums) { bundler_4_mode? }
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }

View File

@ -16,7 +16,6 @@ module Bundler
def install_from_spec
post_install_message = install
Bundler.ui.debug "#{worker}: #{spec.name} (#{spec.version}) from #{spec.loaded_from}"
generate_executable_stubs
[true, post_install_message]
rescue Bundler::InstallHookError, Bundler::SecurityError, Bundler::APIResponseMismatchError, Bundler::InsecureInstallPathError
raise
@ -71,15 +70,5 @@ module Bundler
def out_of_space_message
"#{install_error_message}\nYour disk is out of space. Free some space to be able to install your bundle."
end
def generate_executable_stubs
return if Bundler.feature_flag.forget_cli_options?
return if Bundler.settings[:inline]
if Bundler.settings[:bin] && standalone
installer.generate_standalone_bundler_executable_stubs(spec)
elsif Bundler.settings[:bin]
installer.generate_bundler_executable_stubs(spec, force: true)
end
end
end
end

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-ADD" "1" "August 2025" ""
.TH "BUNDLE\-ADD" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
.SH "SYNOPSIS"

View File

@ -1,24 +1,21 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-BINSTUBS" "1" "August 2025" ""
.TH "BUNDLE\-BINSTUBS" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
.SH "SYNOPSIS"
\fBbundle binstubs\fR \fIGEM_NAME\fR [\-\-force] [\-\-path PATH] [\-\-standalone] [\-\-all\-platforms]
\fBbundle binstubs\fR \fIGEM_NAME\fR [\-\-force] [\-\-standalone] [\-\-all\-platforms]
.SH "DESCRIPTION"
Binstubs are scripts that wrap around executables\. Bundler creates a small Ruby file (a binstub) that loads Bundler, runs the command, and puts it into \fBbin/\fR\. Binstubs are a shortcut\-or alternative\- to always using \fBbundle exec\fR\. This gives you a file that can be run directly, and one that will always run the correct gem version used by the application\.
.P
For example, if you run \fBbundle binstubs rspec\-core\fR, Bundler will create the file \fBbin/rspec\fR\. That file will contain enough code to load Bundler, tell it to load the bundled gems, and then run rspec\.
.P
This command generates binstubs for executables in \fBGEM_NAME\fR\. Binstubs are put into \fBbin\fR, or the \fB\-\-path\fR directory if one has been set\. Calling binstubs with [GEM [GEM]] will create binstubs for all given gems\.
This command generates binstubs for executables in \fBGEM_NAME\fR\. Binstubs are put into \fBbin\fR, or the directory specified by \fBbin\fR setting if it has been configured\. Calling binstubs with [GEM [GEM]] will create binstubs for all given gems\.
.SH "OPTIONS"
.TP
\fB\-\-force\fR
Overwrite existing binstubs if they exist\.
.TP
\fB\-\-path[=PATH]\fR
The location to install the specified binstubs to\. This defaults to \fBbin\fR\.
.TP
\fB\-\-standalone\fR
Makes binstubs that can work without depending on Rubygems or Bundler at runtime\.
.TP

View File

@ -3,7 +3,7 @@ bundle-binstubs(1) -- Install the binstubs of the listed gems
## SYNOPSIS
`bundle binstubs` <GEM_NAME> [--force] [--path PATH] [--standalone] [--all-platforms]
`bundle binstubs` <GEM_NAME> [--force] [--standalone] [--all-platforms]
## DESCRIPTION
@ -19,17 +19,15 @@ the file `bin/rspec`. That file will contain enough code to load Bundler,
tell it to load the bundled gems, and then run rspec.
This command generates binstubs for executables in `GEM_NAME`.
Binstubs are put into `bin`, or the `--path` directory if one has been set.
Calling binstubs with [GEM [GEM]] will create binstubs for all given gems.
Binstubs are put into `bin`, or the directory specified by `bin` setting if it
has been configured. Calling binstubs with [GEM [GEM]] will create binstubs for
all given gems.
## OPTIONS
* `--force`:
Overwrite existing binstubs if they exist.
* `--path[=PATH]`:
The location to install the specified binstubs to. This defaults to `bin`.
* `--standalone`:
Makes binstubs that can work without depending on Rubygems or Bundler at
runtime.

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-CACHE" "1" "August 2025" ""
.TH "BUNDLE\-CACHE" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
.SH "SYNOPSIS"
@ -11,9 +11,6 @@ alias: \fBpackage\fR, \fBpack\fR
Copy all of the \fB\.gem\fR files needed to run the application into the \fBvendor/cache\fR directory\. In the future, when running \fBbundle install(1)\fR \fIbundle\-install\.1\.html\fR, use the gems in the cache in preference to the ones on \fBrubygems\.org\fR\.
.SH "OPTIONS"
.TP
\fB\-\-all\fR
Include all sources (including path and git)\.
.TP
\fB\-\-all\-platforms\fR
Include gems for all platforms present in the lockfile, not only the current one\.
.TP
@ -26,19 +23,10 @@ Use the specified gemfile instead of Gemfile\.
\fB\-\-no\-install\fR
Don't install the gems, only update the cache\.
.TP
\fB\-\-no\-prune\fR
Don't remove stale gems from the cache\.
.TP
\fB\-\-path=PATH\fR
Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME)\.
.TP
\fB\-\-quiet\fR
Only output warnings and errors\.
.TP
\fB\-\-frozen\fR
Do not allow the Gemfile\.lock to be updated after this bundle cache operation's install\.
.SH "GIT AND PATH GEMS"
The \fBbundle cache\fR command can also package \fB:git\fR and \fB:path\fR dependencies besides \.gem files\. This needs to be explicitly enabled via the \fB\-\-all\fR option\. Once used, the \fB\-\-all\fR option will be remembered\.
The \fBbundle cache\fR command can also package \fB:git\fR and \fB:path\fR dependencies besides \.gem files\. This can be disabled setting \fBcache_all\fR to false\.
.SH "SUPPORT FOR MULTIPLE PLATFORMS"
When using gems that have different packages for different platforms, Bundler supports caching of gems for other platforms where the Gemfile has been resolved (i\.e\. present in the lockfile) in \fBvendor/cache\fR\. This needs to be enabled via the \fB\-\-all\-platforms\fR option\. This setting will be remembered in your local bundler configuration\.
.SH "REMOTE FETCHING"

View File

@ -15,9 +15,6 @@ use the gems in the cache in preference to the ones on `rubygems.org`.
## OPTIONS
* `--all`:
Include all sources (including path and git).
* `--all-platforms`:
Include gems for all platforms present in the lockfile, not only the current one.
@ -30,23 +27,13 @@ use the gems in the cache in preference to the ones on `rubygems.org`.
* `--no-install`:
Don't install the gems, only update the cache.
* `--no-prune`:
Don't remove stale gems from the cache.
* `--path=PATH`:
Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).
* `--quiet`:
Only output warnings and errors.
* `--frozen`:
Do not allow the Gemfile.lock to be updated after this bundle cache operation's install.
## GIT AND PATH GEMS
The `bundle cache` command can also package `:git` and `:path` dependencies
besides .gem files. This needs to be explicitly enabled via the `--all` option.
Once used, the `--all` option will be remembered.
besides .gem files. This can be disabled setting `cache_all` to false.
## SUPPORT FOR MULTIPLE PLATFORMS

View File

@ -1,10 +1,10 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-CHECK" "1" "August 2025" ""
.TH "BUNDLE\-CHECK" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
.SH "SYNOPSIS"
\fBbundle check\fR [\-\-dry\-run] [\-\-gemfile=FILE] [\-\-path=PATH]
\fBbundle check\fR [\-\-dry\-run] [\-\-gemfile=FILE]
.SH "DESCRIPTION"
\fBcheck\fR searches the local machine for each of the gems requested in the Gemfile\. If all gems are found, Bundler prints a success message and exits with a status of 0\.
.P
@ -18,7 +18,4 @@ Locks the [\fBGemfile(5)\fR][Gemfile(5)] before running the command\.
.TP
\fB\-\-gemfile=GEMFILE\fR
Use the specified gemfile instead of the [\fBGemfile(5)\fR][Gemfile(5)]\.
.TP
\fB\-\-path=PATH\fR
Specify a different path than the system default (\fB$BUNDLE_PATH\fR or \fB$GEM_HOME\fR)\. Bundler will remember this value for future installs on this machine\.

View File

@ -5,7 +5,6 @@ bundle-check(1) -- Verifies if dependencies are satisfied by installed gems
`bundle check` [--dry-run]
[--gemfile=FILE]
[--path=PATH]
## DESCRIPTION
@ -25,7 +24,3 @@ installed on the local machine, if they satisfy the requirements.
* `--gemfile=GEMFILE`:
Use the specified gemfile instead of the [`Gemfile(5)`][Gemfile(5)].
* `--path=PATH`:
Specify a different path than the system default (`$BUNDLE_PATH` or `$GEM_HOME`).
Bundler will remember this value for future installs on this machine.

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-CLEAN" "1" "August 2025" ""
.TH "BUNDLE\-CLEAN" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-CONFIG" "1" "August 2025" ""
.TH "BUNDLE\-CONFIG" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-config\fR \- Set bundler configuration options
.SH "SYNOPSIS"
@ -77,7 +77,7 @@ Allow Bundler to use cached data when installing without network access\.
Automatically run \fBbundle install\fR when gems are missing\.
.TP
\fBbin\fR (\fBBUNDLE_BIN\fR)
Install executables from gems in the bundle to the specified directory\. Defaults to \fBfalse\fR\.
If configured, \fBbundle binstubs\fR will install executables from gems in the bundle to the specified directory\. Otherwise it will create them in a \fBbin\fR directory relative to the Gemfile directory\. These executables run in Bundler's context\. If used, you might add this directory to your environment's \fBPATH\fR variable\. For instance, if the \fBrails\fR gem comes with a \fBrails\fR executable, \fBbundle binstubs\fR will create a \fBbin/rails\fR executable that ensures that all referred dependencies will be resolved using the bundled gems\.
.TP
\fBcache_all\fR (\fBBUNDLE_CACHE_ALL\fR)
Cache all gems, including path and git gems\. This needs to be explicitly before bundler 4, but will be the default on bundler 4\.
@ -158,10 +158,10 @@ Whether \fBbundle package\fR should skip installing gems\.
Whether Bundler should leave outdated gems unpruned when caching\.
.TP
\fBonly\fR (\fBBUNDLE_ONLY\fR)
A space\-separated list of groups to install only gems of the specified groups\.
A space\-separated list of groups to install only gems of the specified groups\. Please check carefully if you want to install also gems without a group, because they get put inside \fBdefault\fR group\. For example \fBonly test:default\fR will install all gems specified in test group and without one\.
.TP
\fBpath\fR (\fBBUNDLE_PATH\fR)
The location on disk where all gems in your bundle will be located regardless of \fB$GEM_HOME\fR or \fB$GEM_PATH\fR values\. Bundle gems not found in this location will be installed by \fBbundle install\fR\. Defaults to \fB\.bundle\fR relative to repository root in Bundler 4, and to the default system path (\fBGem\.dir\fR) before Bundler 4\.
The location on disk where all gems in your bundle will be located regardless of \fB$GEM_HOME\fR or \fB$GEM_PATH\fR values\. Bundle gems not found in this location will be installed by \fBbundle install\fR\. When not set, Bundler install by default to a \fB\.bundle\fR directory relative to repository root in Bundler 4, and to the default system path (\fBGem\.dir\fR) before Bundler 4\. That means that before Bundler 4, Bundler shares this location with Rubygems, and \fBgem install \|\.\|\.\|\.\fR will have gems installed in the same location and therefore, gems installed without \fBpath\fR set will show up by calling \fBgem list\fR\. This will not be the case in Bundler 4\.
.TP
\fBpath\.system\fR (\fBBUNDLE_PATH__SYSTEM\fR)
Whether Bundler will install gems into the default system path (\fBGem\.dir\fR)\.
@ -222,30 +222,6 @@ A space\-separated or \fB:\fR\-separated list of groups whose gems bundler shoul
.TP
\fBwithout\fR (\fBBUNDLE_WITHOUT\fR)
A space\-separated or \fB:\fR\-separated list of groups whose gems bundler should not install\.
.SH "REMEMBERING OPTIONS"
Flags passed to \fBbundle install\fR or the Bundler runtime, such as \fB\-\-path foo\fR or \fB\-\-without production\fR, are remembered between commands and saved to your local application's configuration (normally, \fB\./\.bundle/config\fR)\.
.P
However, this will be changed in bundler 4, so it's better not to rely on this behavior\. If these options must be remembered, it's better to set them using \fBbundle config\fR (e\.g\., \fBbundle config set \-\-local path foo\fR)\.
.P
The flags that can be configured are:
.TP
\fB\-\-bin\fR
Creates a directory (defaults to \fB~/bin\fR) and place any executables from the gem there\. These executables run in Bundler's context\. If used, you might add this directory to your environment's \fBPATH\fR variable\. For instance, if the \fBrails\fR gem comes with a \fBrails\fR executable, this flag will create a \fBbin/rails\fR executable that ensures that all referred dependencies will be resolved using the bundled gems\.
.TP
\fB\-\-deployment\fR
In deployment mode, Bundler will 'roll\-out' the bundle for \fBproduction\fR use\. Please check carefully if you want to have this option enabled in \fBdevelopment\fR or \fBtest\fR environments\.
.TP
\fB\-\-only\fR
A space\-separated list of groups to install only gems of the specified groups\. Please check carefully if you want to install also gems without a group, cause they get put inside \fBdefault\fR group\. For example \fBonly test:default\fR will install all gems specified in test group and without one\.
.TP
\fB\-\-path\fR
The location to install the specified gems to\. This defaults to Rubygems' setting\. Bundler shares this location with Rubygems, \fBgem install \|\.\|\.\|\.\fR will have gem installed there, too\. Therefore, gems installed without a \fB\-\-path \|\.\|\.\|\.\fR setting will show up by calling \fBgem list\fR\. Accordingly, gems installed to other locations will not get listed\.
.TP
\fB\-\-without\fR
A space\-separated or \fB:\fR\-separated list of groups referencing gems to skip during installation\.
.TP
\fB\-\-with\fR
A space\-separated or \fB:\fR\-separated list of \fBoptional\fR groups referencing gems to include during installation\.
.SH "BUILD OPTIONS"
You can use \fBbundle config\fR to give Bundler the flags to pass to the gem installer every time bundler tries to install a particular gem\.
.P

View File

@ -111,8 +111,14 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
* `auto_install` (`BUNDLE_AUTO_INSTALL`):
Automatically run `bundle install` when gems are missing.
* `bin` (`BUNDLE_BIN`):
Install executables from gems in the bundle to the specified directory.
Defaults to `false`.
If configured, `bundle binstubs` will install executables from gems in the
bundle to the specified directory. Otherwise it will create them in a `bin`
directory relative to the Gemfile directory. These executables run in
Bundler's context. If used, you might add this directory to your
environment's `PATH` variable. For instance, if the `rails` gem comes with a
`rails` executable, `bundle binstubs` will create a `bin/rails` executable
that ensures that all referred dependencies will be resolved using the
bundled gems.
* `cache_all` (`BUNDLE_CACHE_ALL`):
Cache all gems, including path and git gems. This needs to be explicitly
before bundler 4, but will be the default on bundler 4.
@ -193,12 +199,19 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
Whether Bundler should leave outdated gems unpruned when caching.
* `only` (`BUNDLE_ONLY`):
A space-separated list of groups to install only gems of the specified groups.
Please check carefully if you want to install also gems without a group, because
they get put inside `default` group. For example `only test:default` will install
all gems specified in test group and without one.
* `path` (`BUNDLE_PATH`):
The location on disk where all gems in your bundle will be located regardless
of `$GEM_HOME` or `$GEM_PATH` values. Bundle gems not found in this location
will be installed by `bundle install`. Defaults to `.bundle` relative to
repository root in Bundler 4, and to the default system path (`Gem.dir`)
before Bundler 4.
will be installed by `bundle install`. When not set, Bundler install by
default to a `.bundle` directory relative to repository root in Bundler 4,
and to the default system path (`Gem.dir`) before Bundler 4. That means that
before Bundler 4, Bundler shares this location with Rubygems, and `gem
install ...` will have gems installed in the same location and therefore,
gems installed without `path` set will show up by calling `gem list`. This
will not be the case in Bundler 4.
* `path.system` (`BUNDLE_PATH__SYSTEM`):
Whether Bundler will install gems into the default system path (`Gem.dir`).
* `plugins` (`BUNDLE_PLUGINS`):
@ -253,52 +266,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
* `without` (`BUNDLE_WITHOUT`):
A space-separated or `:`-separated list of groups whose gems bundler should not install.
## REMEMBERING OPTIONS
Flags passed to `bundle install` or the Bundler runtime, such as `--path foo` or
`--without production`, are remembered between commands and saved to your local
application's configuration (normally, `./.bundle/config`).
However, this will be changed in bundler 4, so it's better not to rely on this
behavior. If these options must be remembered, it's better to set them using
`bundle config` (e.g., `bundle config set --local path foo`).
The flags that can be configured are:
* `--bin`:
Creates a directory (defaults to `~/bin`) and place any executables from the
gem there. These executables run in Bundler's context. If used, you might add
this directory to your environment's `PATH` variable. For instance, if the
`rails` gem comes with a `rails` executable, this flag will create a
`bin/rails` executable that ensures that all referred dependencies will be
resolved using the bundled gems.
* `--deployment`:
In deployment mode, Bundler will 'roll-out' the bundle for
`production` use. Please check carefully if you want to have this option
enabled in `development` or `test` environments.
* `--only`:
A space-separated list of groups to install only gems of the specified groups.
Please check carefully if you want to install also gems without a group, cause
they get put inside `default` group. For example `only test:default` will install
all gems specified in test group and without one.
* `--path`:
The location to install the specified gems to. This defaults to Rubygems'
setting. Bundler shares this location with Rubygems, `gem install ...` will
have gem installed there, too. Therefore, gems installed without a
`--path ...` setting will show up by calling `gem list`. Accordingly, gems
installed to other locations will not get listed.
* `--without`:
A space-separated or `:`-separated list of groups referencing gems to skip during
installation.
* `--with`:
A space-separated or `:`-separated list of **optional** groups referencing gems to
include during installation.
## BUILD OPTIONS
You can use `bundle config` to give Bundler the flags to pass to the gem

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-CONSOLE" "1" "August 2025" ""
.TH "BUNDLE\-CONSOLE" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-console\fR \- Open an IRB session with the bundle pre\-loaded
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-DOCTOR" "1" "August 2025" ""
.TH "BUNDLE\-DOCTOR" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-doctor\fR \- Checks the bundle for common problems
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-ENV" "1" "August 2025" ""
.TH "BUNDLE\-ENV" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-env\fR \- Print information about the environment Bundler is running under
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-EXEC" "1" "August 2025" ""
.TH "BUNDLE\-EXEC" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-exec\fR \- Execute a command in the context of the bundle
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-FUND" "1" "August 2025" ""
.TH "BUNDLE\-FUND" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-fund\fR \- Lists information about gems seeking funding assistance
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-GEM" "1" "August 2025" ""
.TH "BUNDLE\-GEM" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-HELP" "1" "August 2025" ""
.TH "BUNDLE\-HELP" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-help\fR \- Displays detailed help for each subcommand
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-INFO" "1" "August 2025" ""
.TH "BUNDLE\-INFO" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-info\fR \- Show information for the given gem in your bundle
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-INIT" "1" "August 2025" ""
.TH "BUNDLE\-INIT" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-init\fR \- Generates a Gemfile into the current working directory
.SH "SYNOPSIS"

View File

@ -1,10 +1,10 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-INSTALL" "1" "August 2025" ""
.TH "BUNDLE\-INSTALL" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
.SH "SYNOPSIS"
\fBbundle install\fR [\-\-binstubs[=DIRECTORY]] [\-\-clean] [\-\-deployment] [\-\-force] [\-\-frozen] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-local] [\-\-no\-cache] [\-\-no\-prune] [\-\-path PATH] [\-\-prefer\-local] [\-\-quiet] [\-\-retry=NUMBER] [\-\-shebang=SHEBANG] [\-\-standalone[=GROUP[ GROUP\|\.\|\.\|\.]]] [\-\-system] [\-\-trust\-policy=TRUST\-POLICY] [\-\-target\-rbconfig=TARGET\-RBCONFIG] [\-\-with=GROUP[ GROUP\|\.\|\.\|\.]] [\-\-without=GROUP[ GROUP\|\.\|\.\|\.]]
\fBbundle install\fR [\-\-force] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-local] [\-\-no\-cache] [\-\-prefer\-local] [\-\-quiet] [\-\-retry=NUMBER] [\-\-standalone[=GROUP[ GROUP\|\.\|\.\|\.]]] [\-\-trust\-policy=TRUST\-POLICY] [\-\-target\-rbconfig=TARGET\-RBCONFIG]
.SH "DESCRIPTION"
Install the gems specified in your Gemfile(5)\. If this is the first time you run bundle install (and a \fBGemfile\.lock\fR does not exist), Bundler will fetch all remote sources, resolve dependencies and install all needed gems\.
.P
@ -12,31 +12,15 @@ If a \fBGemfile\.lock\fR does exist, and you have not updated your Gemfile(5), B
.P
If a \fBGemfile\.lock\fR does exist, and you have updated your Gemfile(5), Bundler will use the dependencies in the \fBGemfile\.lock\fR for all gems that you did not update, but will re\-resolve the dependencies of gems that you did update\. You can find more information about this update process below under \fICONSERVATIVE UPDATING\fR\.
.SH "OPTIONS"
The \fB\-\-clean\fR, \fB\-\-deployment\fR, \fB\-\-frozen\fR, \fB\-\-no\-prune\fR, \fB\-\-path\fR, \fB\-\-shebang\fR, \fB\-\-system\fR, \fB\-\-without\fR and \fB\-\-with\fR options are deprecated because they only make sense if they are applied to every subsequent \fBbundle install\fR run automatically and that requires \fBbundler\fR to silently remember them\. Since \fBbundler\fR will no longer remember CLI flags in future versions, \fBbundle config\fR (see bundle\-config(1)) should be used to apply them permanently\.
.TP
\fB\-\-binstubs[=BINSTUBS]\fR
Binstubs are scripts that wrap around executables\. Bundler creates a small Ruby file (a binstub) that loads Bundler, runs the command, and puts it in \fBbin/\fR\. This lets you link the binstub inside of an application to the exact gem version the application needs\.
.IP
Creates a directory (defaults to \fB~/bin\fR when the option is used without a value, or to the given \fB<BINSTUBS>\fR directory otherwise) and places any executables from the gem there\. These executables run in Bundler's context\. If used, you might add this directory to your environment's \fBPATH\fR variable\. For instance, if the \fBrails\fR gem comes with a \fBrails\fR executable, this flag will create a \fBbin/rails\fR executable that ensures that all referred dependencies will be resolved using the bundled gems\.
.TP
\fB\-\-clean\fR
On finishing the installation Bundler is going to remove any gems not present in the current Gemfile(5)\. Don't worry, gems currently in use will not be removed\.
.IP
This option is deprecated in favor of the \fBclean\fR setting\.
.TP
\fB\-\-deployment\fR
In \fIdeployment mode\fR, Bundler will 'roll\-out' the bundle for production or CI use\. Please check carefully if you want to have this option enabled in your development environment\.
.IP
This option is deprecated in favor of the \fBdeployment\fR setting\.
.TP
\fB\-\-force\fR, \fB\-\-redownload\fR
Force reinstalling every gem, even if already installed\.
.TP
\fB\-\-frozen\fR
Do not allow the Gemfile\.lock to be updated after this install\. Exits non\-zero if there are going to be changes to the Gemfile\.lock\.
.IP
This option is deprecated in favor of the \fBfrozen\fR setting\.
.TP
\fB\-\-full\-index\fR
Bundler will not call Rubygems' API endpoint (default) but download and cache a (currently big) index file of all gems\. Performance can be improved for large bundles that seldom change by enabling this option\.
.TP
@ -55,52 +39,22 @@ Force using locally installed gems, or gems already present in Rubygems' cache o
\fB\-\-no\-cache\fR
Do not update the cache in \fBvendor/cache\fR with the newly bundled gems\. This does not remove any gems in the cache but keeps the newly bundled gems from being cached during the install\.
.TP
\fB\-\-no\-prune\fR
Don't remove stale gems from the cache when the installation finishes\.
.IP
This option is deprecated in favor of the \fBno_prune\fR setting\.
.TP
\fB\-\-path=PATH\fR
The location to install the specified gems to\. This defaults to Rubygems' setting\. Bundler shares this location with Rubygems, \fBgem install \|\.\|\.\|\.\fR will have gem installed there, too\. Therefore, gems installed without a \fB\-\-path \|\.\|\.\|\.\fR setting will show up by calling \fBgem list\fR\. Accordingly, gems installed to other locations will not get listed\.
.IP
This option is deprecated in favor of the \fBpath\fR setting\.
.TP
\fB\-\-quiet\fR
Do not print progress information to the standard output\.
.TP
\fB\-\-retry=[<number>]\fR
Retry failed network or git requests for \fInumber\fR times\.
.TP
\fB\-\-shebang=SHEBANG\fR
Uses the specified ruby executable (usually \fBruby\fR) to execute the scripts created with \fB\-\-binstubs\fR\. In addition, if you use \fB\-\-binstubs\fR together with \fB\-\-shebang jruby\fR these executables will be changed to execute \fBjruby\fR instead\.
.IP
This option is deprecated in favor of the \fBshebang\fR setting\.
.TP
\fB\-\-standalone[=<list>]\fR
Makes a bundle that can work without depending on Rubygems or Bundler at runtime\. A space separated list of groups to install can be specified\. Bundler creates a directory named \fBbundle\fR and installs the bundle there\. It also generates a \fBbundle/bundler/setup\.rb\fR file to replace Bundler's own setup in the manner required\. Using this option implicitly sets \fBpath\fR, which is a [remembered option][REMEMBERED OPTIONS]\.
.TP
\fB\-\-system\fR
Installs the gems specified in the bundle to the system's Rubygems location\. This overrides any previous configuration of \fB\-\-path\fR\.
.IP
This option is deprecated in favor of the \fBsystem\fR setting\.
Makes a bundle that can work without depending on Rubygems or Bundler at runtime\. A space separated list of groups to install can be specified\. Bundler creates a directory named \fBbundle\fR and installs the bundle there\. It also generates a \fBbundle/bundler/setup\.rb\fR file to replace Bundler's own setup in the manner required\.
.TP
\fB\-\-trust\-policy=TRUST\-POLICY\fR
Apply the Rubygems security policy \fIpolicy\fR, where policy is one of \fBHighSecurity\fR, \fBMediumSecurity\fR, \fBLowSecurity\fR, \fBAlmostNoSecurity\fR, or \fBNoSecurity\fR\. For more details, please see the Rubygems signing documentation linked below in \fISEE ALSO\fR\.
.TP
\fB\-\-target\-rbconfig=TARGET\-RBCONFIG\fR
Path to rbconfig\.rb for the deployment target platform\.
.TP
\fB\-\-with=<list>\fR
A space\-separated list of groups referencing gems to install\. If an optional group is given it is installed\. If a group is given that is in the remembered list of groups given to \-\-without, it is removed from that list\.
.IP
This option is deprecated in favor of the \fBwith\fR setting\.
.TP
\fB\-\-without=<list>\fR
A space\-separated list of groups referencing gems to skip during installation\. If a group is given that is in the remembered list of groups given to \-\-with, it is removed from that list\.
.IP
This option is deprecated in favor of the \fBwithout\fR setting\.
.SH "DEPLOYMENT MODE"
Bundler's defaults are optimized for development\. To switch to defaults optimized for deployment and for CI, use the \fB\-\-deployment\fR flag\. Do not activate deployment mode on development machines, as it will cause an error when the Gemfile(5) is modified\.
Bundler's defaults are optimized for development\. To switch to defaults optimized for deployment and for CI, use the \fBdeployment\fR setting\. Do not activate deployment mode on development machines, as it will cause an error when the Gemfile(5) is modified\.
.IP "1." 4
A \fBGemfile\.lock\fR is required\.
.IP
@ -120,14 +74,14 @@ In development, it's convenient to share the gems used in your application with
.IP
In deployment, isolation is a more important default\. In addition, the user deploying the application may not have permission to install gems to the system, or the web server may not have permission to read them\.
.IP
As a result, \fBbundle install \-\-deployment\fR installs gems to the \fBvendor/bundle\fR directory in the application\. This may be overridden using the \fB\-\-path\fR option\.
As a result, when \fBdeployment\fR is configured, \fBbundle install\fR installs gems to the \fBvendor/bundle\fR directory in the application\. This may be overridden using the \fBpath\fR setting\.
.IP "" 0
.SH "INSTALLING GROUPS"
By default, \fBbundle install\fR will install all gems in all groups in your Gemfile(5), except those declared for a different platform\.
.P
However, you can explicitly tell Bundler to skip installing certain groups with the \fB\-\-without\fR option\. This option takes a space\-separated list of groups\.
However, you can explicitly tell Bundler to skip installing certain groups with the \fBwithout\fR setting\. This setting takes a space\-separated list of groups\.
.P
While the \fB\-\-without\fR option will skip \fIinstalling\fR the gems in the specified groups, it will still \fIdownload\fR those gems and use them to resolve the dependencies of every gem in your Gemfile(5)\.
While the \fBwithout\fR setting will skip \fIinstalling\fR the gems in the specified groups, \fBbundle install\fR will still \fIdownload\fR those gems and use them to resolve the dependencies of every gem in your Gemfile(5)\.
.P
This is so that installing a different set of groups on another machine (such as a production server) will not change the gems and versions that you have already developed and tested against\.
.P
@ -148,7 +102,7 @@ end
.P
In this case, \fBsinatra\fR depends on any version of Rack (\fB>= 1\.0\fR), while \fBrack\-perftools\-profiler\fR depends on 1\.x (\fB~> 1\.0\fR)\.
.P
When you run \fBbundle install \-\-without production\fR in development, we look at the dependencies of \fBrack\-perftools\-profiler\fR as well\. That way, you do not spend all your time developing against Rack 2\.0, using new APIs unavailable in Rack 1\.x, only to have Bundler switch to Rack 1\.2 when the \fBproduction\fR group \fIis\fR used\.
When you configure \fBbundle config without production\fR in development, we look at the dependencies of \fBrack\-perftools\-profiler\fR as well\. That way, you do not spend all your time developing against Rack 2\.0, using new APIs unavailable in Rack 1\.x, only to have Bundler switch to Rack 1\.2 when the \fBproduction\fR group \fIis\fR used\.
.P
This should not cause any problems in practice, because we do not attempt to \fBinstall\fR the gems in the excluded groups, and only evaluate as part of the dependency resolution process\.
.P

View File

@ -3,28 +3,18 @@ bundle-install(1) -- Install the dependencies specified in your Gemfile
## SYNOPSIS
`bundle install` [--binstubs[=DIRECTORY]]
[--clean]
[--deployment]
[--force]
[--frozen]
`bundle install` [--force]
[--full-index]
[--gemfile=GEMFILE]
[--jobs=NUMBER]
[--local]
[--no-cache]
[--no-prune]
[--path PATH]
[--prefer-local]
[--quiet]
[--retry=NUMBER]
[--shebang=SHEBANG]
[--standalone[=GROUP[ GROUP...]]]
[--system]
[--trust-policy=TRUST-POLICY]
[--target-rbconfig=TARGET-RBCONFIG]
[--with=GROUP[ GROUP...]]
[--without=GROUP[ GROUP...]]
## DESCRIPTION
@ -45,13 +35,6 @@ update process below under [CONSERVATIVE UPDATING][].
## OPTIONS
The `--clean`, `--deployment`, `--frozen`, `--no-prune`, `--path`, `--shebang`,
`--system`, `--without` and `--with` options are deprecated because they only
make sense if they are applied to every subsequent `bundle install` run
automatically and that requires `bundler` to silently remember them. Since
`bundler` will no longer remember CLI flags in future versions, `bundle config`
(see bundle-config(1)) should be used to apply them permanently.
* `--binstubs[=BINSTUBS]`:
Binstubs are scripts that wrap around executables. Bundler creates a small Ruby
file (a binstub) that loads Bundler, runs the command, and puts it in `bin/`.
@ -66,29 +49,9 @@ automatically and that requires `bundler` to silently remember them. Since
create a `bin/rails` executable that ensures that all referred dependencies
will be resolved using the bundled gems.
* `--clean`:
On finishing the installation Bundler is going to remove any gems not present
in the current Gemfile(5). Don't worry, gems currently in use will not be
removed.
This option is deprecated in favor of the `clean` setting.
* `--deployment`:
In [deployment mode][DEPLOYMENT MODE], Bundler will 'roll-out' the bundle for
production or CI use. Please check carefully if you want to have this option
enabled in your development environment.
This option is deprecated in favor of the `deployment` setting.
* `--force`, `--redownload`:
Force reinstalling every gem, even if already installed.
* `--frozen`:
Do not allow the Gemfile.lock to be updated after this install. Exits
non-zero if there are going to be changes to the Gemfile.lock.
This option is deprecated in favor of the `frozen` setting.
* `--full-index`:
Bundler will not call Rubygems' API endpoint (default) but download and cache
a (currently big) index file of all gems. Performance can be improved for
@ -122,47 +85,18 @@ automatically and that requires `bundler` to silently remember them. Since
does not remove any gems in the cache but keeps the newly bundled gems from
being cached during the install.
* `--no-prune`:
Don't remove stale gems from the cache when the installation finishes.
This option is deprecated in favor of the `no_prune` setting.
* `--path=PATH`:
The location to install the specified gems to. This defaults to Rubygems'
setting. Bundler shares this location with Rubygems, `gem install ...` will
have gem installed there, too. Therefore, gems installed without a
`--path ...` setting will show up by calling `gem list`. Accordingly, gems
installed to other locations will not get listed.
This option is deprecated in favor of the `path` setting.
* `--quiet`:
Do not print progress information to the standard output.
* `--retry=[<number>]`:
Retry failed network or git requests for <number> times.
* `--shebang=SHEBANG`:
Uses the specified ruby executable (usually `ruby`) to execute the scripts
created with `--binstubs`. In addition, if you use `--binstubs` together with
`--shebang jruby` these executables will be changed to execute `jruby`
instead.
This option is deprecated in favor of the `shebang` setting.
* `--standalone[=<list>]`:
Makes a bundle that can work without depending on Rubygems or Bundler at
runtime. A space separated list of groups to install can be specified.
Bundler creates a directory named `bundle` and installs the bundle there. It
also generates a `bundle/bundler/setup.rb` file to replace Bundler's own setup
in the manner required. Using this option implicitly sets `path`, which is a
[remembered option][REMEMBERED OPTIONS].
* `--system`:
Installs the gems specified in the bundle to the system's Rubygems location.
This overrides any previous configuration of `--path`.
This option is deprecated in favor of the `system` setting.
in the manner required.
* `--trust-policy=TRUST-POLICY`:
Apply the Rubygems security policy <policy>, where policy is one of
@ -173,26 +107,11 @@ automatically and that requires `bundler` to silently remember them. Since
* `--target-rbconfig=TARGET-RBCONFIG`:
Path to rbconfig.rb for the deployment target platform.
* `--with=<list>`:
A space-separated list of groups referencing gems to install. If an
optional group is given it is installed. If a group is given that is
in the remembered list of groups given to --without, it is removed
from that list.
This option is deprecated in favor of the `with` setting.
* `--without=<list>`:
A space-separated list of groups referencing gems to skip during installation.
If a group is given that is in the remembered list of groups given
to --with, it is removed from that list.
This option is deprecated in favor of the `without` setting.
## DEPLOYMENT MODE
Bundler's defaults are optimized for development. To switch to
defaults optimized for deployment and for CI, use the `--deployment`
flag. Do not activate deployment mode on development machines, as it
defaults optimized for deployment and for CI, use the `deployment`
setting. Do not activate deployment mode on development machines, as it
will cause an error when the Gemfile(5) is modified.
1. A `Gemfile.lock` is required.
@ -224,9 +143,9 @@ will cause an error when the Gemfile(5) is modified.
gems to the system, or the web server may not have permission to
read them.
As a result, `bundle install --deployment` installs gems to
the `vendor/bundle` directory in the application. This may be
overridden using the `--path` option.
As a result, when `deployment` is configured, `bundle install` installs gems
to the `vendor/bundle` directory in the application. This may be
overridden using the `path` setting.
## INSTALLING GROUPS
@ -234,12 +153,12 @@ By default, `bundle install` will install all gems in all groups
in your Gemfile(5), except those declared for a different platform.
However, you can explicitly tell Bundler to skip installing
certain groups with the `--without` option. This option takes
certain groups with the `without` setting. This setting takes
a space-separated list of groups.
While the `--without` option will skip _installing_ the gems in the
specified groups, it will still _download_ those gems and use them to
resolve the dependencies of every gem in your Gemfile(5).
While the `without` setting will skip _installing_ the gems in the
specified groups, `bundle install` will still _download_ those gems and use them
to resolve the dependencies of every gem in your Gemfile(5).
This is so that installing a different set of groups on another
machine (such as a production server) will not change the
@ -265,7 +184,7 @@ For a simple illustration, consider the following Gemfile(5):
In this case, `sinatra` depends on any version of Rack (`>= 1.0`), while
`rack-perftools-profiler` depends on 1.x (`~> 1.0`).
When you run `bundle install --without production` in development, we
When you configure `bundle config without production` in development, we
look at the dependencies of `rack-perftools-profiler` as well. That way,
you do not spend all your time developing against Rack 2.0, using new
APIs unavailable in Rack 1.x, only to have Bundler switch to Rack 1.2

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-ISSUE" "1" "August 2025" ""
.TH "BUNDLE\-ISSUE" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-issue\fR \- Get help reporting Bundler issues
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-LICENSES" "1" "August 2025" ""
.TH "BUNDLE\-LICENSES" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-licenses\fR \- Print the license of all gems in the bundle
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-LIST" "1" "August 2025" ""
.TH "BUNDLE\-LIST" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-list\fR \- List all the gems in the bundle
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-LOCK" "1" "August 2025" ""
.TH "BUNDLE\-LOCK" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-OPEN" "1" "August 2025" ""
.TH "BUNDLE\-OPEN" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-OUTDATED" "1" "August 2025" ""
.TH "BUNDLE\-OUTDATED" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-outdated\fR \- List installed gems with newer versions available
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-PLATFORM" "1" "August 2025" ""
.TH "BUNDLE\-PLATFORM" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-platform\fR \- Displays platform compatibility information
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-PLUGIN" "1" "August 2025" ""
.TH "BUNDLE\-PLUGIN" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-plugin\fR \- Manage Bundler plugins
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-PRISTINE" "1" "August 2025" ""
.TH "BUNDLE\-PRISTINE" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-REMOVE" "1" "August 2025" ""
.TH "BUNDLE\-REMOVE" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-remove\fR \- Removes gems from the Gemfile
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-SHOW" "1" "August 2025" ""
.TH "BUNDLE\-SHOW" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-UPDATE" "1" "August 2025" ""
.TH "BUNDLE\-UPDATE" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-update\fR \- Update your gems to the latest available versions
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE\-VERSION" "1" "August 2025" ""
.TH "BUNDLE\-VERSION" "1" "September 2025" ""
.SH "NAME"
\fBbundle\-version\fR \- Prints Bundler version information
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "BUNDLE" "1" "August 2025" ""
.TH "BUNDLE" "1" "September 2025" ""
.SH "NAME"
\fBbundle\fR \- Ruby Dependency Management
.SH "SYNOPSIS"

View File

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "GEMFILE" "5" "August 2025" ""
.TH "GEMFILE" "5" "September 2025" ""
.SH "NAME"
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
.SH "SYNOPSIS"

View File

@ -20,7 +20,6 @@ module Bundler
disable_shared_gems
disable_version_check
force_ruby_platform
forget_cli_options
frozen
gem.changelog
gem.coc
@ -43,20 +42,6 @@ module Bundler
verbose
].freeze
REMEMBERED_KEYS = %w[
bin
cache_all
clean
deployment
frozen
no_prune
path
shebang
path.system
without
with
].freeze
NUMBER_KEYS = %w[
jobs
redirect
@ -128,12 +113,8 @@ module Bundler
end
def set_command_option(key, value)
if !is_remembered(key) || Bundler.feature_flag.forget_cli_options?
temporary(key => value)
value
else
set_local(key, value)
end
temporary(key => value)
value
end
def set_command_option_if_given(key, value)
@ -387,10 +368,6 @@ module Bundler
ARRAY_KEYS.include?(self.class.key_to_s(key))
end
def is_remembered(key)
REMEMBERED_KEYS.include?(self.class.key_to_s(key))
end
def is_credential(key)
key == "gem.push_key"
end

View File

@ -144,26 +144,4 @@ RSpec.describe "bundle cache with path" do
bundle :cache
expect(bundled_app("vendor/cache/bar-1.0")).to exist
end
it "can rewind chosen configuration" do
build_lib "foo"
install_gemfile <<-G
source "https://gem.repo1"
gem "foo", :path => '#{lib_path("foo-1.0")}'
G
bundle "config set cache_all true"
bundle :cache
build_lib "baz"
gemfile <<-G
source "https://gem.repo1"
gem "foo", :path => '#{lib_path("foo-1.0")}'
gem "baz", :path => '#{lib_path("baz-1.0")}'
G
bundle "cache --no-all", raise_on_error: false
expect(bundled_app("vendor/cache/baz-1.0")).not_to exist
end
end

View File

@ -156,29 +156,20 @@ RSpec.describe "bundle binstubs <gem>" do
end
end
context "--path" do
it "sets the binstubs dir" do
install_gemfile <<-G
source "https://gem.repo1"
gem "myrack"
G
bundle "binstubs myrack --path exec"
expect(bundled_app("exec/myrackup")).to exist
context "with the binstubs dir configured" do
before do
bundle "config bin exec"
end
it "setting is saved for bundle install" do
it "creates the binstubs in the configured dir" do
install_gemfile <<-G
source "https://gem.repo1"
gem "myrack"
gem "rails"
G
bundle "binstubs myrack", path: "exec"
bundle :install
bundle "binstubs myrack"
expect(bundled_app("exec/rails")).to exist
expect(bundled_app("exec/myrackup")).to exist
end
end
@ -201,11 +192,10 @@ RSpec.describe "bundle binstubs <gem>" do
expect(File.read(bundled_app("bin/myrackup"))).to_not include("Gem.bin_path")
end
context "when specified --path option" do
it "generates a standalone binstub at the given path" do
bundle "binstubs myrack --standalone --path foo"
expect(bundled_app("foo/myrackup")).to exist
end
it "generates a standalone binstub at the given path when configured" do
bundle "config bin foo"
bundle "binstubs myrack --standalone"
expect(bundled_app("foo/myrackup")).to exist
end
context "when specified --all-platforms option" do

View File

@ -28,7 +28,7 @@ RSpec.describe "bundle cache" do
end
end
context "with --all" do
context "with cache_all configured" do
context "without a gemspec" do
it "caches all dependencies except bundler itself" do
gemfile <<-D
@ -158,20 +158,6 @@ RSpec.describe "bundle cache" do
end
end
context "with --path" do
it "sets root directory for gems" do
gemfile <<-D
source "https://gem.repo1"
gem 'myrack'
D
bundle "cache --path #{bundled_app("test")}"
expect(the_bundle).to include_gems "myrack 1.0.0"
expect(bundled_app("test/vendor/cache/")).to exist
end
end
context "with --no-install" do
it "puts the gems in vendor/cache but does not install them" do
gemfile <<-D
@ -290,39 +276,6 @@ RSpec.describe "bundle cache" do
end
end
it "enforces frozen mode when --frozen is passed" do
gemfile <<-G
source "https://gem.repo1"
gem "myrack"
gem "myrack-obama"
G
lockfile <<-L
GEM
remote: https://gem.repo1/
specs:
myrack (1.0.0)
PLATFORMS
#{lockfile_platforms}
DEPENDENCIES
myrack
BUNDLED WITH
#{Bundler::VERSION}
L
bundle "cache --frozen", raise_on_error: false
expect(exitstatus).to eq(16)
expect(err).to include("frozen mode")
expect(err).to include("You have added to the Gemfile")
expect(err).to include("* myrack-obama")
bundle "env"
expect(out).to include("frozen")
end
context "with frozen configured" do
let(:app_cache) { bundled_app("vendor/cache") }

View File

@ -123,19 +123,6 @@ RSpec.describe "bundle check" do
expect(err).to include("Bundler can't satisfy your Gemfile's dependencies.")
end
it "remembers --without option from install" do
gemfile <<-G
source "https://gem.repo1"
group :foo do
gem "myrack"
end
G
bundle "install --without foo"
bundle "check"
expect(out).to include("The Gemfile's dependencies are satisfied")
end
it "uses the without setting" do
bundle "config set without foo"
install_gemfile <<-G
@ -272,46 +259,6 @@ RSpec.describe "bundle check" do
expect(last_command).to be_failure
end
context "--path" do
context "after installing gems in the proper directory" do
before do
gemfile <<-G
source "https://gem.repo1"
gem "rails"
G
bundle "install --path vendor/bundle"
FileUtils.rm_r(bundled_app(".bundle"))
end
it "returns success" do
bundle "check --path vendor/bundle"
expect(out).to include("The Gemfile's dependencies are satisfied")
end
it "should write to .bundle/config" do
bundle "check --path vendor/bundle"
bundle "check"
end
end
context "after installing gems on a different directory" do
before do
install_gemfile <<-G
source "https://gem.repo1"
gem "rails"
G
bundle "check --path vendor/bundle", raise_on_error: false
end
it "returns false" do
expect(exitstatus).to eq(1)
expect(err).to match(/The following gems are missing/)
end
end
end
describe "when locked" do
before :each do
system_gems "myrack-1.0.0"

View File

@ -383,50 +383,6 @@ RSpec.describe "bundle clean" do
expect(out).to include("myrack (1.0.0)").and include("thin (1.0)")
end
it "--clean should override the bundle setting on install" do
gemfile <<-G
source "https://gem.repo1"
gem "thin"
gem "myrack"
G
bundle "config set path vendor/bundle"
bundle "config set clean false"
bundle "install --clean true"
gemfile <<-G
source "https://gem.repo1"
gem "myrack"
G
bundle "install"
should_have_gems "myrack-1.0.0"
should_not_have_gems "thin-1.0"
end
it "--clean should override the bundle setting on update" do
build_repo2
gemfile <<-G
source "https://gem.repo2"
gem "foo"
G
bundle "config set path vendor/bundle"
bundle "config set clean false"
bundle "install --clean true"
update_repo2 do
build_gem "foo", "1.0.1"
end
bundle "update", all: true
should_have_gems "foo-1.0.1"
should_not_have_gems "foo-1.0"
end
it "automatically cleans when path has not been set", bundler: "5" do
build_repo2
@ -451,7 +407,7 @@ RSpec.describe "bundle clean" do
]
end
it "does not clean automatically on --path" do
it "does not clean automatically when path configured" do
gemfile <<-G
source "https://gem.repo1"
@ -471,7 +427,7 @@ RSpec.describe "bundle clean" do
should_have_gems "myrack-1.0.0", "thin-1.0"
end
it "does not clean on bundle update with --path" do
it "does not clean on bundle update when path configured" do
build_repo2
gemfile <<-G
@ -490,7 +446,7 @@ RSpec.describe "bundle clean" do
should_have_gems "foo-1.0", "foo-1.0.1"
end
it "does not clean on bundle update when using --system" do
it "does not clean on bundle update when installing to system gems" do
bundle "config set path.system true"
build_repo2

View File

@ -340,20 +340,6 @@ RSpec.describe "bundle install with gem sources" do
bundle "install"
expect(the_bundle).to include_gems "myrack 1.0"
end
it "allows running bundle install --system without deleting foo" do
bundle "install --path vendor"
bundle "install --system"
FileUtils.rm_r(bundled_app("vendor"))
expect(the_bundle).to include_gems "myrack 1.0"
end
it "allows running bundle install --system after deleting foo" do
bundle "install --path vendor"
FileUtils.rm_r(bundled_app("vendor"))
bundle "install --system"
expect(the_bundle).to include_gems "myrack 1.0"
end
end
it "finds gems in multiple sources" do

View File

@ -155,33 +155,6 @@ RSpec.describe "post bundle message" do
end
end
describe "for second bundle install run after first run using --without" do
it "with --without one group" do
bundle "install --without emo"
bundle :install
expect(out).to include(bundle_show_system_message)
expect(out).to include("Gems in the group 'emo' were not installed")
expect(out).to include(bundle_complete_message)
expect(out).to include(installed_gems_stats)
end
it "with --without two groups" do
bundle "install --without emo test"
bundle :install
expect(out).to include(bundle_show_system_message)
expect(out).to include("Gems in the groups 'emo' and 'test' were not installed")
expect(out).to include(bundle_complete_message)
end
it "with --without more groups" do
bundle "install --without emo obama test"
bundle :install
expect(out).to include(bundle_show_system_message)
expect(out).to include("Gems in the groups 'emo', 'obama' and 'test' were not installed")
expect(out).to include(bundle_complete_message)
end
end
describe "for bundle update" do
it "shows proper messages according to the configured groups" do
bundle :update, all: true

View File

@ -8,72 +8,6 @@ RSpec.describe "install in deployment or frozen mode" do
G
end
context "with CLI flags" do
it "fails without a lockfile and says that --deployment requires a lock" do
bundle "install --deployment", raise_on_error: false
expect(err).to include("The --deployment flag requires a lockfile")
end
it "fails without a lockfile and says that --frozen requires a lock" do
bundle "install --frozen", raise_on_error: false
expect(err).to include("The --frozen flag requires a lockfile")
end
it "disallows --deployment --system" do
bundle "install --deployment --system", raise_on_error: false
expect(err).to include("You have specified both --deployment")
expect(err).to include("Please choose only one option")
expect(exitstatus).to eq(15)
end
it "disallows --deployment --path --system" do
bundle "install --deployment --path . --system", raise_on_error: false
expect(err).to include("You have specified both --path")
expect(err).to include("as well as --system")
expect(err).to include("Please choose only one option")
expect(exitstatus).to eq(15)
end
it "doesn't mess up a subsequent `bundle install` after you try to deploy without a lock" do
bundle "install --deployment", raise_on_error: false
bundle :install
expect(the_bundle).to include_gems "myrack 1.0"
end
it "installs gems by default to vendor/bundle" do
bundle :lock
bundle "install --deployment"
expect(out).to include("vendor/bundle")
end
it "installs gems to custom path if specified" do
bundle :lock
bundle "install --path vendor/bundle2 --deployment"
expect(out).to include("vendor/bundle2")
end
it "works with the --frozen flag" do
bundle :lock
bundle "install --frozen"
end
it "explodes with the --deployment flag if you make a change and don't check in the lockfile" do
bundle :lock
gemfile <<-G
source "https://gem.repo1"
gem "myrack"
gem "myrack-obama"
G
bundle "install --deployment", raise_on_error: false
expect(err).to include("frozen mode")
expect(err).to include("You have added to the Gemfile")
expect(err).to include("* myrack-obama")
expect(err).not_to include("You have deleted from the Gemfile")
expect(err).not_to include("You have changed in the Gemfile")
end
end
it "fails without a lockfile and says that deployment requires a lock" do
bundle "config deployment true"
bundle "install", raise_on_error: false

View File

@ -113,13 +113,6 @@ RSpec.describe "bundle install with groups" do
expect(the_bundle).not_to include_gems "activesupport 2.3.5", groups: [:default]
end
it "remembers previous exclusion with `--without`" do
bundle "install --without emo"
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
bundle :install
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
end
it "does not say it installed gems from the excluded group" do
bundle "config set --local without emo"
bundle :install
@ -159,20 +152,6 @@ RSpec.describe "bundle install with groups" do
ENV["BUNDLE_WITHOUT"] = nil
end
it "clears --without when passed an empty list" do
bundle "install --without emo"
bundle "install --without ''"
expect(the_bundle).to include_gems "activesupport 2.3.5"
end
it "doesn't clear without when nothing is passed" do
bundle "install --without emo"
bundle :install
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
end
it "does not install gems from the optional group" do
bundle :install
expect(the_bundle).not_to include_gems "thin 1.0"
@ -184,13 +163,6 @@ RSpec.describe "bundle install with groups" do
expect(the_bundle).to include_gems "thin 1.0"
end
it "installs gems from the previously requested group" do
bundle "install --with debugging"
expect(the_bundle).to include_gems "thin 1.0"
bundle :install
expect(the_bundle).to include_gems "thin 1.0"
end
it "installs gems from the optional groups requested with BUNDLE_WITH" do
ENV["BUNDLE_WITH"] = "debugging"
bundle :install
@ -198,30 +170,6 @@ RSpec.describe "bundle install with groups" do
ENV["BUNDLE_WITH"] = nil
end
it "clears --with when passed an empty list" do
bundle "install --with debugging"
bundle "install --with ''"
expect(the_bundle).not_to include_gems "thin 1.0"
end
it "removes groups from without when passed at --with" do
bundle "config set --local without emo"
bundle "install --with emo"
expect(the_bundle).to include_gems "activesupport 2.3.5"
end
it "removes groups from with when passed at --without" do
bundle "config set --local with debugging"
bundle "install --without debugging", raise_on_error: false
expect(the_bundle).not_to include_gem "thin 1.0"
end
it "errors out when passing a group to with and without via CLI flags" do
bundle "install --with emo debugging --without emo", raise_on_error: false
expect(last_command).to be_failure
expect(err).to include("The offending groups are: emo")
end
it "allows the BUNDLE_WITH setting to override BUNDLE_WITHOUT" do
ENV["BUNDLE_WITH"] = "debugging"
@ -235,12 +183,6 @@ RSpec.describe "bundle install with groups" do
expect(the_bundle).to include_gem "thin 1.0"
end
it "can add and remove a group at the same time" do
bundle "install --with debugging --without emo"
expect(the_bundle).to include_gems "thin 1.0"
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
end
it "has no effect when listing a not optional group in with" do
bundle "config set --local with emo"
bundle :install
@ -365,7 +307,7 @@ RSpec.describe "bundle install with groups" do
end
end
describe "when locked and installed with `without` option" do
describe "when locked and installed with `without` setting" do
before(:each) do
build_repo2
@ -382,7 +324,7 @@ RSpec.describe "bundle install with groups" do
G
end
it "uses the correct versions even if --without was used on the original" do
it "uses versions from excluded gems in a machine without the without configuration" do
expect(the_bundle).to include_gems "myrack 0.9.1"
expect(the_bundle).not_to include_gems "myrack_middleware 1.0"
simulate_new_machine

View File

@ -529,40 +529,6 @@ RSpec.describe "compact index api" do
expect(out).to include("Fetching gem metadata from #{source_uri}")
end
it "installs the binstubs" do
gemfile <<-G
source "#{source_uri}"
gem "myrack"
G
bundle "install --binstubs", artifice: "compact_index"
gembin "myrackup"
expect(out).to eq("1.0.0")
end
it "installs the bins when using --path and uses autoclean" do
gemfile <<-G
source "#{source_uri}"
gem "myrack"
G
bundle "install --path vendor/bundle", artifice: "compact_index"
expect(vendored_gems("bin/myrackup")).to exist
end
it "installs the bins when using --path and uses bundle clean" do
gemfile <<-G
source "#{source_uri}"
gem "myrack"
G
bundle "install --path vendor/bundle --no-clean", artifice: "compact_index"
expect(vendored_gems("bin/myrackup")).to exist
end
it "prints post_install_messages" do
gemfile <<-G
source "#{source_uri}"

View File

@ -471,40 +471,6 @@ RSpec.describe "gemcutter's dependency API" do
expect(out).to include("Fetching gem metadata from #{source_uri}")
end
it "installs the binstubs" do
gemfile <<-G
source "#{source_uri}"
gem "myrack"
G
bundle "install --binstubs", artifice: "endpoint"
gembin "myrackup"
expect(out).to eq("1.0.0")
end
it "installs the bins when using --path and uses autoclean" do
gemfile <<-G
source "#{source_uri}"
gem "myrack"
G
bundle "install --path vendor/bundle", artifice: "endpoint"
expect(vendored_gems("bin/myrackup")).to exist
end
it "installs the bins when using --path and uses bundle clean" do
gemfile <<-G
source "#{source_uri}"
gem "myrack"
G
bundle "install --path vendor/bundle --no-clean", artifice: "endpoint"
expect(vendored_gems("bin/myrackup")).to exist
end
it "prints post_install_messages" do
gemfile <<-G
source "#{source_uri}"

View File

@ -464,53 +464,6 @@ RSpec.describe "bundle install --standalone" do
include_examples "common functionality"
end
end
describe "with --binstubs" do
before do
gemfile <<-G
source "https://gem.repo1"
gem "rails"
G
bundle "config set --local path #{bundled_app("bundle")}"
bundle :install, standalone: true, binstubs: true, dir: cwd
end
let(:expected_gems) do
{
"actionpack" => "2.3.2",
"rails" => "2.3.2",
}
end
include_examples "common functionality"
it "creates stubs that use the standalone load path" do
expect(in_bundled_app("bin/rails -v").chomp).to eql "2.3.2"
end
it "creates stubs that can be executed from anywhere" do
require "tmpdir"
sys_exec(%(#{bundled_app("bin/rails")} -v), dir: Dir.tmpdir)
expect(out).to eq("2.3.2")
end
it "creates stubs that can be symlinked" do
skip "symlinks unsupported" if Gem.win_platform?
symlink_dir = tmp("symlink")
FileUtils.mkdir_p(symlink_dir)
symlink = File.join(symlink_dir, "rails")
File.symlink(bundled_app("bin/rails"), symlink)
sys_exec("#{symlink} -v")
expect(out).to eq("2.3.2")
end
it "creates stubs with the correct load path" do
extension_line = File.read(bundled_app("bin/rails")).each_line.find {|line| line.include? "$:.unshift" }.strip
expect(extension_line).to eq %($:.unshift File.expand_path "../bundle", __dir__)
end
end
end
RSpec.describe "bundle install --standalone run in a subdirectory" do

View File

@ -44,21 +44,6 @@ RSpec.describe "bundle install" do
expect(out).to include("gems are installed into `./vendor/bundle`")
end
it "disallows --path vendor/bundle --system" do
bundle "install --path vendor/bundle --system", raise_on_error: false
expect(err).to include("Please choose only one option.")
expect(exitstatus).to eq(15)
end
it "remembers to disable system gems after the first time with bundle --path vendor/bundle" do
bundle "install --path vendor/bundle"
FileUtils.rm_r bundled_app("vendor")
bundle "install"
expect(vendored_gems("gems/myrack-1.0.0")).to be_directory
expect(the_bundle).to include_gems "myrack 1.0.0"
end
it "installs the bundle relatively to repository root, when Bundler run from the same directory" do
bundle "config path vendor/bundle", dir: bundled_app.parent
bundle "install --gemfile='#{bundled_app}/Gemfile'", dir: bundled_app.parent
@ -75,21 +60,12 @@ RSpec.describe "bundle install" do
expect(the_bundle).to include_gems "myrack 1.0.0"
end
it "installs the bundle relatively to Gemfile folder, when repository root can't be inferred from settings" do
bundle "install --gemfile='#{bundled_app}/Gemfile' --path vendor/bundle", dir: bundled_app.parent
expect(out).to include("installed into `./bundled_app/vendor/bundle`")
expect(bundled_app("vendor/bundle")).to be_directory
expect(the_bundle).to include_gems "myrack 1.0.0"
end
it "installs the standalone bundle relative to the cwd" do
bundle :install, gemfile: bundled_app_gemfile, standalone: true, dir: bundled_app.parent
expect(out).to include("installed into `./bundled_app/bundle`")
expect(bundled_app("bundle")).to be_directory
expect(bundled_app("bundle/ruby")).to be_directory
bundle "config unset path"
bundle :install, gemfile: bundled_app_gemfile, standalone: true, dir: bundled_app("subdir").tap(&:mkpath)
expect(out).to include("installed into `../bundle`")
expect(bundled_app("bundle")).to be_directory

View File

@ -107,16 +107,14 @@ RSpec.describe "major deprecations" do
bundle "check --path vendor/bundle", raise_on_error: false
end
it "should print a deprecation warning" do
expect(deprecations).to include(
"The `--path` flag is deprecated because it relies on being " \
"remembered across bundler invocations, which bundler will no " \
"longer do in future versions. Instead please use `bundle config set " \
"path 'vendor/bundle'`, and stop using this flag"
it "fails with a helpful error" do
expect(err).to include(
"The `--path` flag has been removed because it relied on being " \
"remembered across bundler invocations, which bundler no longer " \
"does. Instead please use `bundle config set path 'vendor/bundle'`, " \
"and stop using this flag"
)
end
pending "fails with a helpful error", bundler: "4"
end
context "bundle check --path=" do
@ -129,16 +127,14 @@ RSpec.describe "major deprecations" do
bundle "check --path=vendor/bundle", raise_on_error: false
end
it "should print a deprecation warning" do
expect(deprecations).to include(
"The `--path` flag is deprecated because it relies on being " \
"remembered across bundler invocations, which bundler will no " \
"longer do in future versions. Instead please use `bundle config set " \
"path 'vendor/bundle'`, and stop using this flag"
it "fails with a helpful error" do
expect(err).to include(
"The `--path` flag has been removed because it relied on being " \
"remembered across bundler invocations, which bundler no longer " \
"does. Instead please use `bundle config set path 'vendor/bundle'`, " \
"and stop using this flag"
)
end
pending "fails with a helpful error", bundler: "4"
end
context "bundle binstubs --path=" do
@ -151,16 +147,14 @@ RSpec.describe "major deprecations" do
bundle "binstubs myrack --path=binpath", raise_on_error: false
end
it "should print a deprecation warning" do
expect(deprecations).to include(
"The `--path` flag is deprecated because it relies on being " \
"remembered across bundler invocations, which bundler will no " \
"longer do in future versions. Instead please use `bundle config set " \
"bin 'binpath'`, and stop using this flag"
it "fails with a helpful error" do
expect(err).to include(
"The `--path` flag has been removed because it relied on being " \
"remembered across bundler invocations, which bundler no longer " \
"does. Instead please use `bundle config set bin 'binpath'`, " \
"and stop using this flag"
)
end
pending "fails with a helpful error", bundler: "4"
end
context "bundle cache --all" do
@ -170,19 +164,17 @@ RSpec.describe "major deprecations" do
gem "myrack"
G
bundle "cache --all", raise_on_error: false
bundle "cache --all --verbose", raise_on_error: false
end
it "should print a deprecation warning" do
expect(deprecations).to include(
"The `--all` flag is deprecated because it relies on being " \
"remembered across bundler invocations, which bundler will no " \
"longer do in future versions. Instead please use `bundle config set " \
"cache_all true`, and stop using this flag"
it "fails with a helpful error" do
expect(err).to include(
"The `--all` flag has been removed because it relied on being " \
"remembered across bundler invocations, which bundler no longer " \
"does. Instead please use `bundle config set cache_all true`, " \
"and stop using this flag"
)
end
pending "fails with a helpful error", bundler: "4"
end
context "bundle cache --no-all" do
@ -195,16 +187,14 @@ RSpec.describe "major deprecations" do
bundle "cache --no-all", raise_on_error: false
end
it "should print a deprecation warning" do
expect(deprecations).to include(
"The `--no-all` flag is deprecated because it relies on being " \
"remembered across bundler invocations, which bundler will no " \
"longer do in future versions. Instead please use `bundle config set " \
"cache_all false`, and stop using this flag"
it "fails with a helpful error" do
expect(err).to include(
"The `--no-all` flag has been removed because it relied on being " \
"remembered across bundler invocations, which bundler no longer " \
"does. Instead please use `bundle config set cache_all false`, " \
"and stop using this flag"
)
end
pending "fails with a helpful error", bundler: "4"
end
context "bundle cache --path" do
@ -217,16 +207,14 @@ RSpec.describe "major deprecations" do
bundle "cache --path foo", raise_on_error: false
end
it "should print a deprecation warning" do
expect(deprecations).to include(
"The `--path` flag is deprecated because its semantics are unclear. " \
it "should print a removal error" do
expect(err).to include(
"The `--path` flag has been removed because its semantics were unclear. " \
"Use `bundle config cache_path` to configure the path of your cache of gems, " \
"and `bundle config path` to configure the path where your gems are installed, " \
"and stop using this flag"
)
end
pending "fails with a helpful error", bundler: "4"
end
context "bundle cache --path=" do
@ -240,15 +228,13 @@ RSpec.describe "major deprecations" do
end
it "should print a deprecation warning" do
expect(deprecations).to include(
"The `--path` flag is deprecated because its semantics are unclear. " \
expect(err).to include(
"The `--path` flag has been removed because its semantics were unclear. " \
"Use `bundle config cache_path` to configure the path of your cache of gems, " \
"and `bundle config path` to configure the path where your gems are installed, " \
"and stop using this flag"
)
end
pending "fails with a helpful error", bundler: "4"
end
context "bundle cache --frozen" do
@ -261,16 +247,14 @@ RSpec.describe "major deprecations" do
bundle "cache --frozen", raise_on_error: false
end
it "should print a deprecation warning" do
expect(deprecations).to include(
"The `--frozen` flag is deprecated because it relies on being " \
"remembered across bundler invocations, which bundler will no " \
"longer do in future versions. Instead please use `bundle config set " \
"frozen true`, and stop using this flag"
it "fails with a helpful error" do
expect(err).to include(
"The `--frozen` flag has been removed because it relied on being " \
"remembered across bundler invocations, which bundler no longer " \
"does. Instead please use `bundle config set frozen true`, " \
"and stop using this flag"
)
end
pending "fails with a helpful error", bundler: "4"
end
context "bundle cache --no-prune" do
@ -283,16 +267,14 @@ RSpec.describe "major deprecations" do
bundle "cache --no-prune", raise_on_error: false
end
it "should print a deprecation warning" do
expect(deprecations).to include(
"The `--no-prune` flag is deprecated because it relies on being " \
"remembered across bundler invocations, which bundler will no " \
"longer do in future versions. Instead please use `bundle config set " \
"no_prune true`, and stop using this flag"
it "fails with a helpful error" do
expect(err).to include(
"The `--no-prune` flag has been removed because it relied on being " \
"remembered across bundler invocations, which bundler no longer " \
"does. Instead please use `bundle config set no_prune true`, " \
"and stop using this flag"
)
end
pending "fails with a helpful error", bundler: "4"
end
describe "bundle config" do
@ -479,23 +461,23 @@ RSpec.describe "major deprecations" do
}.each do |name, expectations|
option_name, value = *expectations
flag_name = "--#{name}"
args = %w[true false].include?(value) ? flag_name : "#{flag_name} #{value}"
context "with the #{flag_name} flag" do
before do
bundle "install" # to create a lockfile, which deployment or frozen need
bundle "install #{flag_name} #{value}"
bundle "install #{args}", raise_on_error: false
end
it "should print a deprecation warning" do
expect(deprecations).to include(
"The `#{flag_name}` flag is deprecated because it relies on " \
"being remembered across bundler invocations, which bundler " \
"will no longer do in future versions. Instead please use " \
"`bundle config set #{option_name} #{value}`, and stop using this flag"
it "fails with a helpful error" do
expect(err).to include(
"The `#{flag_name}` flag has been removed because it relied on " \
"being remembered across bundler invocations, which bundler no " \
"longer does. Instead please use `bundle config set " \
"#{option_name} #{value}`, and stop using this flag"
)
end
pending "fails with a helpful error", bundler: "4"
end
end
end

View File

@ -136,7 +136,6 @@ RSpec.describe "The library itself" do
it "documents all used settings" do
exemptions = %w[
forget_cli_options
gem.changelog
gem.ci
gem.coc

View File

@ -19,8 +19,9 @@ RSpec.describe "Running bin/* commands" do
expect(out).to eq("1.0.0")
end
it "allows the location of the gem stubs to be specified" do
bundle "binstubs myrack", path: "gbin"
it "allows the location of the gem stubs to be configured" do
bundle "config bin gbin"
bundle "binstubs myrack"
expect(bundled_app("bin")).not_to exist
expect(bundled_app("gbin/myrackup")).to exist
@ -30,7 +31,8 @@ RSpec.describe "Running bin/* commands" do
end
it "allows absolute paths as a specification of where to install bin stubs" do
bundle "binstubs myrack", path: tmp("bin")
bundle "config bin #{tmp("bin")}"
bundle "binstubs myrack"
gembin tmp("bin/myrackup")
expect(out).to eq("1.0.0")
@ -96,38 +98,6 @@ RSpec.describe "Running bin/* commands" do
expect(bundled_app("bin/myrackup")).not_to exist
end
it "allows you to stop installing binstubs" do
skip "delete permission error" if Gem.win_platform?
bundle "install --binstubs bin/"
bundled_app("bin/myrackup").rmtree
bundle "install --binstubs \"\""
expect(bundled_app("bin/myrackup")).not_to exist
bundle "config bin"
expect(out).to include("You have not configured a value for `bin`")
end
it "remembers that the option was specified" do
gemfile <<-G
source "https://gem.repo1"
gem "activesupport"
G
bundle :install, binstubs: "bin"
gemfile <<-G
source "https://gem.repo1"
gem "activesupport"
gem "myrack"
G
bundle "install"
expect(bundled_app("bin/myrackup")).to exist
end
it "rewrites bins on binstubs with --force option" do
install_gemfile <<-G
source "https://gem.repo1"