diff --git a/lib/bundler/cli/pristine.rb b/lib/bundler/cli/pristine.rb index 532b3e0b5bb..4a411a83fc7 100644 --- a/lib/bundler/cli/pristine.rb +++ b/lib/bundler/cli/pristine.rb @@ -33,7 +33,7 @@ def run if extension_cache_path = source.extension_cache_path(spec) FileUtils.rm_rf extension_cache_path end - FileUtils.rm_rf spec.extension_dir + FileUtils.rm_rf spec.extension_dir if spec.respond_to?(:extension_dir) FileUtils.rm_rf spec.full_gem_path else Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")