bazelruby / rules_ruby

Formerly canonical rules for ruby, that are about 2-3 years behind current Bazel. If they work for you great, but if not — please try the new rules ruby by Alex Radionov: https://github.com/bazel-contrib/rules_ruby
Apache License 2.0
99 stars 37 forks source link

Setup script attempts to delete ~/.rbenv if rbenv is installed with Homebrew #81

Closed shepting closed 3 years ago

shepting commented 4 years ago

I can't tell for sure, but the setup script seems to try to delete ~/.rbenv if there is no bin/rbenv executable inside there. I believe that Homebrew installs the rbenv binary in /usr/oca/bin/rbenv.

I tried to run the bin/setup command on my Mac, but then was worried that it seemed to want to delete ~/.rbenv. Screen Shot 2020-09-29 at 4 38 07 PM

My ~/.rbenv just has shims and versions whereas my rbenv executable comes from /usr/local/bin/rbenv: Screen Shot 2020-09-29 at 4 40 20 PM

shepting commented 4 years ago

I think that this is the chunk that should likely be updated: https://github.com/bazelruby/rules_ruby/blob/master/bin/setup#L44-L48

shepting commented 4 years ago

I believe the proper approach would be to run rbenv install 2.7.1 with rbenv if it's installed. The setup script is then able to run flawlessly:

shepting commented 4 years ago

Screen Shot 2020-09-29 at 4 54 52 PM

kigster commented 3 years ago

Yikes, I don't remember why it as trying to delete it but I'll take a look and fix it. Thanks for reporting!