diff --git a/TODO.md b/TODO.md index 9a80fb82d91..028a657a49c 100644 --- a/TODO.md +++ b/TODO.md @@ -6,7 +6,6 @@ - bundle irb / bundle ruby / bundle [whatever] -> bundle exec - Make bundle (install) work when sudo might be needed - Generate a bundle stub into the application - - Handle materialization errors - Handle the following case (no remote fetching): 1) Depend on nokogiri, nokogiri is installed locally (ruby platform) 2) Run bundle package. nokogiri-1.4.2.gem is cached diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 6eb727e4496..32c9bf9e2b5 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -72,7 +72,7 @@ def materialize(deps, missing_specs = nil) if missing_specs missing_specs << s unless spec else - raise "Could not materialize #{s.full_name}" unless spec + raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec end spec if spec end diff --git a/spec/runtime/platform_spec.rb b/spec/runtime/platform_spec.rb new file mode 100644 index 00000000000..5137ea6060d --- /dev/null +++ b/spec/runtime/platform_spec.rb @@ -0,0 +1,34 @@ +require "spec_helper" + +describe "Bundler.setup with multi platform stuff" do + it "raises a friendly error when gems are missing locally" do + gemfile <<-G + source "file://#{gem_repo1}" + gem "rack" + G + + lockfile <<-G + GEM + remote: file:#{gem_repo1}/ + specs: + rack (1.0) + + PLATFORMS + #{local_tag} + + DEPENDENCIES + rack + G + + ruby <<-R + begin + require 'bundler' + Bundler.setup + rescue Bundler::GemNotFound => e + puts "WIN" + end + R + + out.should == "WIN" + end +end \ No newline at end of file