summaryrefslogtreecommitdiff
path: root/lib/bundler/resolver.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-07-31 14:10:59 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-08-31 19:06:14 +0900
commit0b4dbe2e6a0a0b27860fb6a509ff0429ece436c7 (patch)
tree5aa8e35b7ffe852ee7b16f97cfaab9872b71e925 /lib/bundler/resolver.rb
parent2e850e0038e8ba9a5dd3266e9f0f6b2821f19084 (diff)
[rubygems/rubygems] Improve "gem not found in source" errors
When printing sources inside these error messages, it's useful to only consider the current state of the source. For example, when requiring `bundler/setup`, the source shouldn't be configured to be able to hit the network, so the error message should only mention "locally installed gems" to make that more clear. https://github.com/rubygems/rubygems/commit/30eb14f853
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4789
Diffstat (limited to 'lib/bundler/resolver.rb')
-rw-r--r--lib/bundler/resolver.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 0e28e8559b..d26e2feb10 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -272,7 +272,7 @@ module Bundler
rescue GemfileNotFound
nil
end
- message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
+ message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source.to_err}#{cache_message}.\n")
message << "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}" if versions_with_platforms.any?
end
raise GemNotFound, message
@@ -371,7 +371,7 @@ module Bundler
o << if metadata_requirement
"is not available in #{relevant_source}"
else
- "in #{relevant_source}.\n"
+ "in #{relevant_source.to_err}.\n"
end
end
end,