Issue
I was feeling perhaps a bit overambitious in trying to follow online tutorials to install a Jekyll bundler on my Mac (MacOS Monterey 12.5.1), in hopes that I could choose from a broader range of templates in making my own GitHub pages website.
Since I couldn't get the terminal command to install Jekyll to work (some error about not having the permissions), I found another tutorial that had instructions to install homebrew so that I could then install the Jekyll bundler.
That tutorial said to enter the following text into the terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
I did that and it showed me a ton of text that looked like maybe it was working (sorry, didn't save it at the time to share here).
When I put in the next line in the tutorial instructions to update brew, it just says:
-bash: brew: command not found
and when I try to check the version of brew, it does the same thing. So I don't think the install worked.
And that's fine. I think I'm going to give up on jekyll and homebrew, and not risk messing something up in my computer without knowing what I'm doing. I'm just worried about whether I already messed anything up.
The reason I'm worried is that after I put in that tutorial command to install homebrew, everytime I got the new input/command line, it had a message that began with:
"The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh`."
I ran the code the message instructs. But I don't actually understand what the original command from the tutorial did. It obviously didn't do what it was supposed to do, but it also clearly did something, and I'm hoping someone who actually understands this code could let me know if there might be anything I should do to undo the effects of this all and clean up any mess I might have made in my computer. Thanks in advance!
Solution
-bash: brew: command not found
This indicates there is no program called "brew" in your PATH variable. There are a number of reasons why after an install, the command would not be available to you.
You may just need to refresh your shell cache. If this is the issue, running one of these will resolve it.
hash
rehash
Depending on whether your macOS system is Intel or M1/M2, the location of the brew binary installed changes.
Intel it is stored in /usr/local/bin/brew
M1/M2 stores it in /opt/homebrew/bin
These new paths are not in your start up scripts by default. You will need to make sure they are added.
To add them to your path, use Terminal.app or iTerm3.app:
% open .profile ; open .cshrc ; open .zshrc; open .login; open .bash_profile
The file /Users/risner/.zshrc does not exist.
The file /Users/risner/.login does not exist.
Ignore any "does not exist" errors. You should have a couple files opened with TextEdit.app
Look for assignments to "path =" for .cshrc or .login and "PATH=" for others.
Modify them to add the path you need.
Once added, a reboot or exit Terminal.app and restart should make brew be recognized as a command.
"The default interactive shell is now zsh. To update your account to use zsh, please run
chsh -s /bin/zsh
."
At some point, someone at Apple decided advising older user to change from tcsh to zsh was a good idea. My guess is all new documentation will be written with zsh in mind and they'd rather we all used it. The two shells (tcsh/csh and zsh) are similar in function but quite a bit differ in other ways. For the most part, if you are not using advanced features in them, they are identical. I'd leave it at zsh unless you wish to revert back.
Answered By - James Risner Answer Checked By - David Marino (WPSolving Volunteer)