summaryrefslogtreecommitdiff
path: root/lib/bundler/installer
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/installer')
-rw-r--r--lib/bundler/installer/parallel_installer.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/bundler/installer/parallel_installer.rb b/lib/bundler/installer/parallel_installer.rb
index b1a997f3f2..97c124e015 100644
--- a/lib/bundler/installer/parallel_installer.rb
+++ b/lib/bundler/installer/parallel_installer.rb
@@ -90,6 +90,7 @@ module Bundler
@standalone = standalone
@force = force
@specs = all_specs.map {|s| SpecInstallation.new(s) }
+ @spec_set = all_specs
end
def call
@@ -116,7 +117,7 @@ module Bundler
spec_install.post_install_message = message
elsif !success
spec_install.state = :failed
- spec_install.error = message
+ spec_install.error = "#{message}\n\n#{require_tree_for_spec(spec_install.spec)}"
end
spec_install
}
@@ -166,6 +167,19 @@ module Bundler
Bundler.ui.warn(warning.join("\n"))
end
+ def require_tree_for_spec(spec)
+ tree = @spec_set.what_required(spec)
+ t = String.new("In #{File.basename(SharedHelpers.default_gemfile)}:\n")
+ tree.each_with_index do |s, depth|
+ t << " " * depth.succ << s.name
+ unless tree.last == s
+ t << %( was resolved to #{s.version}, which depends on)
+ end
+ t << %(\n)
+ end
+ t
+ end
+
# Keys in the remains hash represent uninstalled gems specs.
# We enqueue all gem specs that do not have any dependencies.
# Later we call this lambda again to install specs that depended on