diff options
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/resolver.rb | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index d22ab34e..48f0d468 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -341,10 +341,11 @@ module Bundler "try passing them all to `bundle update`" elsif requirement.source name = requirement.name - versions = @source_requirements[name][name].map(&:version) - message = String.new("Could not find gem '#{requirement}' in #{requirement.source}.\n") - message << if versions.any? - "Source contains '#{name}' at: #{versions.join(", ")}" + specs = @source_requirements[name][name] + versions_with_platforms = specs.map {|s| [s.version, s.platform] } + message = String.new("Could not find gem '#{requirement}' in #{requirement.source}.\n") + message << if versions_with_platforms.any? + "Source contains '#{name}' at: #{formatted_versions_with_platforms(versions_with_platforms)}" else "Source does not contain any versions of '#{requirement}'" end @@ -355,5 +356,15 @@ module Bundler raise GemNotFound, message end end + + def formatted_versions_with_platforms(versions_with_platforms) + version_platform_strs = versions_with_platforms.map do |vwp| + version = vwp.first + platform = vwp.last + version_platform_str = String.new(version.to_s) + version_platform_str << " #{platform}" unless platform.nil? + end + version_platform_strs.join(", ") + end end end |