diff --git a/rubygems_plugin.rb b/rubygems_plugin.rb index 43369da..a7ca45d 100644 --- a/rubygems_plugin.rb +++ b/rubygems_plugin.rb @@ -4,5 +4,8 @@ end end -Gem.post_install(&hook) -Gem.post_uninstall(&hook) +shims_path = File.join(ENV['RBENV_ROOT'], "shims") +if File.writable?(shims_path) + Gem.post_install(&hook) + Gem.post_uninstall(&hook) +end