diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-08-02 16:10:45 -0700 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-08-02 16:10:45 -0700 |
commit | c430dca7e2175a17dce3315ebc05cf7b48adcf3f (patch) | |
tree | 4cb60a0d0df091ecd78ae29e351c4617e172b0bd | |
parent | 40e170da27653c856c6260c563c4b9c80b260447 (diff) | |
download | bundler-c430dca7e2175a17dce3315ebc05cf7b48adcf3f.tar.gz |
The CLI should print a better warning on bundle check if the resolver can't get all the way through
-rw-r--r-- | lib/bundler/cli.rb | 8 | ||||
-rw-r--r-- | spec/other/check_spec.rb | 12 |
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index e092f30887..8112437260 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -59,7 +59,13 @@ module Bundler If not, the first missing gem is listed and Bundler exits status 1. D def check - not_installed = Bundler.definition.missing_specs + begin + not_installed = Bundler.definition.missing_specs + rescue GemNotFound, VersionConflict + Bundler.ui.error "Your Gemfile's dependencies could not be satisfied" + Bundler.ui.warn "Install missing gems with `bundle install`" + exit 1 + end if not_installed.any? Bundler.ui.error "The following gems are missing" diff --git a/spec/other/check_spec.rb b/spec/other/check_spec.rb index 188351a35a..aaedbc26be 100644 --- a/spec/other/check_spec.rb +++ b/spec/other/check_spec.rb @@ -25,6 +25,18 @@ describe "bundle check" do bundled_app("Gemfile.lock").should exist end + it "prints a generic error if the missing gems are unresolvable" do + system_gems ["rails-2.3.2"] + + gemfile <<-G + source "file://#{gem_repo1}" + gem "rails" + G + + bundle :check + out.should include("Your Gemfile's dependencies could not be satisfied") + end + it "shows what is missing with the current Gemfile if it is not satisfied" do gemfile <<-G source "file://#{gem_repo1}" |