diff options
Diffstat (limited to 'lib/bundler/resolver.rb')
-rw-r--r-- | lib/bundler/resolver.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index 55a96ebf44..f29887de0a 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -148,8 +148,23 @@ module Bundler if matching_versions.empty? if current.required_by.empty? + if current.source + name = current.name + versions = @source_requirements[name][name].map { |s| s.version } + message = "Could not find gem '#{current}' in #{current.source}.\n" + if versions.any? + message << "Source contains '#{current.name}' at: #{versions.join(', ')}" + else + message << "Source does not contain any versions of '#{current}'" + end + + raise GemNotFound, message + else + raise GemNotFound, "Could not find gem '#{current}' in any of the sources." + end location = current.source ? current.source.to_s : "any of the sources" - raise GemNotFound, "Could not find gem '#{current}' in #{location}" + raise GemNotFound, "Could not find gem '#{current}' in #{location}.\n" \ + "Source contains fo" else @errors[current.name] = [nil, current] end |