diff options
author | Andre Arko <andre@arko.net> | 2014-04-01 20:46:24 +0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2014-04-01 20:46:24 +0800 |
commit | 4f0003ba76f08364303dda3a6338334c5e7d1f7b (patch) | |
tree | 6be4ef2f32c3939f7cc73bbd2926a28cc757d7cc | |
parent | 7cf9eaccf289a671761dbad70cdd296de3675798 (diff) | |
download | bundler-4f0003ba76f08364303dda3a6338334c5e7d1f7b.tar.gz |
only remove paths that are there
-rw-r--r-- | lib/bundler/source/rubygems.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 4422079e6b..d3d576fb18 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -122,7 +122,9 @@ module Bundler installed_spec.loaded_from = spec.loaded_from ["Installing #{version_message(spec)}", spec.post_install_message] ensure - FileUtils.remove_entry_secure(install_path) if Bundler.requires_sudo? + if defined?(install_path) && Bundler.requires_sudo? + FileUtils.remove_entry_secure(install_path) + end end def cache(spec, custom_path = nil) |