mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Simplify error message building in resolver
Since all requirements have an explicit source now (even if it's the
default source).
2c341cfc22
This commit is contained in:
parent
b17cdad2f8
commit
b351cebab2
Notes:
git
2021-08-31 19:07:21 +09:00
1 changed files with 2 additions and 4 deletions
|
@ -269,14 +269,12 @@ module Bundler
|
|||
"Try running `bundle update #{name}`\n\n" \
|
||||
"If you are updating multiple gems in your Gemfile at once,\n" \
|
||||
"try passing them all to `bundle update`"
|
||||
elsif source = @source_requirements[name]
|
||||
else
|
||||
source = source_for(name)
|
||||
specs = source.specs.search(name)
|
||||
versions_with_platforms = specs.map {|s| [s.version, s.platform] }
|
||||
message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
|
||||
message << "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}" if versions_with_platforms.any?
|
||||
else
|
||||
message = "Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in any of the gem sources " \
|
||||
"listed in your Gemfile#{cache_message}."
|
||||
end
|
||||
raise GemNotFound, message
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue