I have a fairly new macbook pro and I'm simply trying to install homebrew according to the directions on their site:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
However, when I run this I get the following output:
The user \u cannot be found
There was an unknown error.
This script requires the user \u to be an Administrator.
My macbook only has 1 user, which is me, the Administrator. That's who I'm logged in as on the computer.
Another thing I've tried is running the command with sudo
, in which case I get the following message:
Don't run this as root!
Another thing I've tried is downloading Command Line Tools (CLT) for Xcode: xcode-select --install
as I saw this suggested on Homebrew's site and elsewhere online.
After creating a new user with "Admin" privileges apart from my root account, the homebrew install command above started to run but then quit with the following error:
/usr/local/homebrew/.git: Permission denied
Failed during: git init -q
At this point I'm stuck and not sure what to do.
I was able to install Homebrew using the following steps. Note I did this on a non-root admin user account. I had to create this user account separately and give it admin access just to do this. Once I logged out of my root account and logged into the admin non-root account, I typed the following commands into terminal:
xcode-select --install
cd /usr/local/Homebrew
git init
git remote add origin https://github.com/Homebrew/brew
git fetch --all
git checkout -B master origin/master
cd /usr/local
ln -s /usr/local/Homebrew/bin/brew /usr/local/bin
I found most of these steps here:
https://github.com/Homebrew/homebrew-core/issues/5084#issuecomment-248834806
Hope this helps someone else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With