bundler/lib/bundler/man/gemfile.5.ronn in rubygems-update-3.3.18 vs bundler/lib/bundler/man/gemfile.5.ronn in rubygems-update-3.3.19

- old
+ new

@@ -13,27 +13,32 @@ ## SYNTAX A `Gemfile` is evaluated as Ruby code, in a context which makes available a number of methods used to describe the gem requirements. -## GLOBAL SOURCES +## GLOBAL SOURCE -At the top of the `Gemfile`, add a line for the `Rubygems` source that contains -the gems listed in the `Gemfile`. +At the top of the `Gemfile`, add a single line for the `RubyGems` source that +contains the gems listed in the `Gemfile`. source "https://rubygems.org" -It is possible, but not recommended as of Bundler 1.7, to add multiple global -`source` lines. Each of these `source`s `MUST` be a valid Rubygems repository. +You can add only one global source. In Bundler 1.13, adding multiple global +sources was deprecated. The `source` `MUST` be a valid RubyGems repository. -Sources are checked for gems following the heuristics described in -[SOURCE PRIORITY][]. If a gem is found in more than one global source, Bundler +To use more than one source of RubyGems, you should use [`source` block +](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS). + +A source is checked for gems following the heuristics described in +[SOURCE PRIORITY][]. + +**Note about a behavior of the feature deprecated in Bundler 1.13**: +If a gem is found in more than one global source, Bundler will print a warning after installing the gem indicating which source was used, and listing the other sources where the gem is available. A specific source can be selected for gems that need to use a non-standard repository, suppressing -this warning, by using the [`:source` option](#SOURCE) or a -[`source` block](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS). +this warning, by using the [`:source` option](#SOURCE) or `source` block. ### CREDENTIALS Some gem sources require a username and password. Use [bundle config(1)](bundle-config.1.html) to set the username and password for any of the sources that need it. The command must @@ -245,26 +250,26 @@ a `required_ruby_version` upper bound), but you still want your Gemfile{.lock} files to resolve under that ruby. ### SOURCE -You can select an alternate Rubygems repository for a gem using the ':source' +You can select an alternate RubyGems repository for a gem using the ':source' option. gem "some_internal_gem", source: "https://gems.example.com" -This forces the gem to be loaded from this source and ignores any global sources +This forces the gem to be loaded from this source and ignores the global source declared at the top level of the file. If the gem does not exist in this source, it will not be installed. Bundler will search for child dependencies of this gem by first looking in the source selected for the parent, but if they are not found there, it will fall -back on global sources using the ordering described in [SOURCE PRIORITY][]. +back on the global source. +**Note about a behavior of the feature deprecated in Bundler 1.13**: Selecting a specific source repository this way also suppresses the ambiguous -gem warning described above in -[GLOBAL SOURCES (#source)](#GLOBAL-SOURCES). +gem warning described above in [GLOBAL SOURCE](#GLOBAL-SOURCE). Using the `:source` option for an individual gem will also make that source available as a possible global source for any other gems which do not specify explicit sources. Thus, when adding gems with explicit sources, it is recommended that you also ensure all other gems in the Gemfile are using @@ -533,7 +538,9 @@ `:git`) 2. For implicit gems (dependencies of explicit gems), any source, git, or path repository declared on the parent. This results in bundler prioritizing the ActiveSupport gem from the Rails git repository over ones from `rubygems.org` - 3. The sources specified via global `source` lines, searching each source in - your `Gemfile` from last added to first added. + 3. If neither of the above conditions are met, the global source will be used. + If multiple global sources are specified, they will be prioritized from + last to first, but this is deprecated since Bundler 1.13, so Bundler prints + a warning and will abort with an error in the future.