summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-06-19 12:02:49 -0700
committerwycats <wycats@gmail.com>2010-06-29 14:53:11 -0700
commit16fd4ac50953d06ba0d2b16a686347ed5992705b (patch)
tree880d567931f88f4ac6c85307467849da28b77979
parent564c3a1fe18f449e0ae563a5e9e8cc6a98945867 (diff)
downloadbundler-16fd4ac50953d06ba0d2b16a686347ed5992705b.tar.gz
Catch inexplicably missing bundler gems
-rw-r--r--lib/bundler/resolver.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 630ae06170..1cdb6a6e36 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -191,12 +191,16 @@ module Bundler
# Check if the gem has already been activated, if it has, we will make sure
# that the currently activated gem satisfies the requirement.
- if existing = activated[current.name] or current.name == 'bundler'
+ existing = activated[current.name]
+ if existing || current.name == 'bundler'
# Force the current
if current.name == 'bundler' && !existing
- # TODO: handle existing still == nil
- existing = search(DepProxy.new(Gem::Dependency.new('bundler', VERSION), Gem::Platform::RUBY)).first
- activated[current.name] = existing
+ bundler_gem = search(DepProxy.new(Gem::Dependency.new('bundler', VERSION), Gem::Platform::RUBY)).first
+ if bundler_gem
+ activated[current.name] = bundler_gem
+ else
+ raise GemNotFound, %Q{Bundler could not find gem "bundler" (#{VERSION})}
+ end
end
if current.requirement.satisfied_by?(existing.version)