diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/bundler/definition.rb | 18 | ||||
| -rw-r--r-- | lib/bundler/dsl.rb | 13 |
2 files changed, 15 insertions, 16 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 9ce38209d6..84b7236a1f 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -608,10 +608,20 @@ module Bundler missing_specs.each do |s| locked_gem = @locked_specs[s.name].last next if locked_gem.nil? || locked_gem.version != s.version || sources.local_mode? - raise GemNotFound, "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \ - "no longer be found in that source. That means the author of #{locked_gem} has removed it. " \ - "You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \ - "removed in order to install." + + message = if sources.implicit_global_source? + "Because your Gemfile specifies no global remote source, your bundle is locked to " \ + "#{locked_gem} from #{locked_gem.source}. However, #{locked_gem} is not installed. You'll " \ + "need to either add a global remote source to your Gemfile or make sure #{locked_gem} is " \ + "available locally before rerunning Bundler." + else + "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \ + "no longer be found in that source. That means the author of #{locked_gem} has removed it. " \ + "You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \ + "removed in order to install." + end + + raise GemNotFound, message end missing_specs_list = missing_specs.group_by(&:source).map do |source, missing_specs_for_source| diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index df904f074a..a7b7df84a6 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -503,18 +503,7 @@ module Bundler end def check_rubygems_source_safety - if @sources.implicit_global_source? - implicit_global_source_warning - elsif @sources.aggregate_global_source? - multiple_global_source_warning - end - end - - def implicit_global_source_warning - Bundler::SharedHelpers.major_deprecation 2, "This Gemfile does not include an explicit global source. " \ - "Not using an explicit global source may result in a different lockfile being generated depending on " \ - "the gems you have installed locally before bundler is run. " \ - "Instead, define a global source in your Gemfile like this: source \"https://rubygems.org\"." + multiple_global_source_warning if @sources.aggregate_global_source? end def multiple_global_source_warning |
