Permalink
Browse files

Merge pull request #1380 from rwilcox/bundler

Error message fingering bad gems that fail to install
  • Loading branch information...
2 parents 9591d71 + 82ac6b6 commit 86c7fb77634341665dead68bd2f52b1209cbf691 @indirect indirect committed Sep 13, 2011
Showing with 19 additions and 12 deletions.
  1. +19 −12 lib/bundler/installer.rb
View
@@ -47,21 +47,28 @@ def run(options)
# as dependencies might actually affect the installation of
# the gem.
specs.each do |spec|
- spec.source.fetch(spec) if spec.source.respond_to?(:fetch)
+ begin
+ spec.source.fetch(spec) if spec.source.respond_to?(:fetch)
- # unless requested_specs.include?(spec)
- # Bundler.ui.debug " * Not in requested group; skipping."
- # next
- # end
+ # unless requested_specs.include?(spec)
+ # Bundler.ui.debug " * Not in requested group; skipping."
+ # next
+ # end
- Bundler.rubygems.with_build_args [Bundler.settings["build.#{spec.name}"]] do
- spec.source.install(spec)
- Bundler.ui.debug "from #{spec.loaded_from} "
- end
+ Bundler.rubygems.with_build_args [Bundler.settings["build.#{spec.name}"]] do
+ spec.source.install(spec)
+ Bundler.ui.debug "from #{spec.loaded_from} "
+ end
- Bundler.ui.info ""
- generate_bundler_executable_stubs(spec) if Bundler.settings[:bin]
- FileUtils.rm_rf(Bundler.tmp)
+ Bundler.ui.info ""
+ generate_bundler_executable_stubs(spec) if Bundler.settings[:bin]
+ FileUtils.rm_rf(Bundler.tmp)
+ rescue Exception => e
+ Bundler.ui.warn "#{e.class}: #{e.message}"
+ Bundler.ui.error "An error (#{e.message}) occured while installing #{spec.name} (#{spec.version})"
+ Bundler.ui.error "Bundler can not continue. Try manually installing the gem, to determine if this is a Bundler specfic issue or issue with the gem itself"
+ raise
+ end
end
lock

0 comments on commit 86c7fb7

Please sign in to comment.