diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb index d703e2345e..bd38353d3c 100644 --- a/lib/bundler/runtime.rb +++ b/lib/bundler/runtime.rb @@ -125,7 +125,6 @@ module Bundler specs_to_cache.each do |spec| next if spec.name == "bundler" next if spec.source.is_a?(Source::Gemspec) - spec.source.send(:fetch_gem, spec) if Bundler.settings[:cache_all_platforms] && spec.source.respond_to?(:fetch_gem, true) spec.source.cache(spec, custom_path) if spec.source.respond_to?(:cache) end diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 04ba4a654c..7200f54a9c 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -242,7 +242,7 @@ module Bundler end def cache(spec, custom_path = nil) - cached_path = cached_gem(spec) + cached_path = Bundler.settings[:cache_all_platforms] ? fetch_gem(spec) : cached_gem(spec) raise GemNotFound, "Missing gem file '#{spec.file_name}'." unless cached_path return if File.dirname(cached_path) == Bundler.app_cache.to_s Bundler.ui.info " * #{File.basename(cached_path)}"