ruby-install
ruby-install copied to clipboard
If installed using Homebrew, ruby-install errors because sudo installs are no longer allowed
Env:
- mac OS X: 10.12.2
- Homebrew: 1.1.8
- ruby-install: 0.6.1
As of Nov 1st, it appears that homebrew added this restriction: here
https://github.com/postmodern/ruby-install/blob/cc831fcfb8a96a04a38f961b69b2d1172330cefd/share/ruby-install/util.sh#L98-L99
My temp fix:
- downloaded the source and
make install
ed it - failed in the same fashion - removed
sudo -u "$brew_owner"
from the two lines linked above andmake install
ed it - failed for permissions -
sudo make install
built it and works
Probably because this /usr/bin/stat -f %Su "$(command -v brew)")"
evaluates to root based on my system install
I guess this is more environment configuration than a bug with ruby-install
, would it make sense to have a warning thrown if $brew_owner
is ever root?
the problem for me is that
$ ls -l /usr/local/bin/brew
lrwxr-xr-x 1 root wheel 28 Jan 4 14:03 /usr/local/bin/brew -> /usr/local/Homebrew/bin/brew
/usr/local/Homebrew/bin/brew
has myself as its owner.
http://docs.brew.sh/Troubleshooting.html
@josephholsten, from that page try running
cd /usr/local && sudo chown -R $(whoami) bin etc include lib sbin share var Frameworks
I prefer:
sudo chown -R $(whoami) /usr/local
I'm not sure what causes it, but sometimes the /usr/local
directory becomes owned by root
.
@havenwood it's not macOS-only anymore, as Homebrew is officially supported on Linux too now.
I have it installed on my Solus, as I needed to install something with it, and now have the same issue.
However, I can use --no-install-deps
to skip that step, and move on as usual.
Is this still an issue? 0.8.2 added better logic for when and when-not-to use sudo
with brew
. See 093608aed1d189ec6f8a919fe95b9b7e1812e252
I did manage to get this a couple of times; this last time, first time on an M2 macbook, for some reason, /opt/homebrew/bin/brew
was a symlink to /opt/homebrew/Homebrew/bin/brew
, and whilst my user owned the latter, target executable, the symlink was marked as owned by root
, which made ruby-install attempt sudo -u root ....
for it's commands
Fixing the symlink removed the issue, but wanted to note it here in case it helps others. Or me, in 4-6 months time, most likely.