postmodern / ruby-install

Installs Ruby, JRuby, TruffleRuby, or mruby
MIT License
1.9k stars 252 forks source link

ruby-install fails in cases where homebrew is installed with a different prefix #392

Closed kthelgason closed 2 years ago

kthelgason commented 3 years ago

If homebrew is installed outside of usr/local then the sudo brew command will fail as the PATH variable in the execution environment most likely won't include the brew executable.

One idea is to pass --preserve-env=PATH to the invocation to sudo, but that requires the executing user to have the brew executable on their PATH. Another solution would be to get the full path to the executable using brew --prefix but that has the same requirement. Is that an acceptable constraint?

I'm happy to provide a patch.

postmodern commented 3 years ago

PR #396 has been merged (and will be released in 0.8.2) which will not use sudo to run brew, if homebrew was installed by the current user.

postmodern commented 2 years ago

0.8.2 and 0.8.3 were released. This should be fixed.