zsh: command not found: brew in mac - macos

I had homebrew installed on my mac. Today after sometime, I tried to download psql through brew on my mac on terminal but I keeping getting:
zsh: command not found: brew
I have it installed so I do not know why zsh is not picking brew?

First you have run the below command for install homebrew on particular path
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
And then set the path using below command
echo export PATH="/opt/homebrew/bin:$PATH" >> ~/.zshrc
Its working fine for MacOS

Related

Why I can't install brew on macOS?

I am trying to install brew on my co-worker's macOS. I have brew on my computer.
Not sure why we are having problems to install it on his computer. I am following this turial.
When I run:
% brew doctor
zsh: command not found: brew
It says brew was not installed.
I already edited his path at .zshrc. However, I did not put the comment suggested on the tutorial. Not sure if it makes any difference:
#Michaels-MacBook-Air ~ % cat .zshrc
export PATH=/usr/local/bin:$PATH
This is on:
#Michaels-MacBook-Air ~ % pwd
/Users/michaels
In addition, I already executed:
/bin/bash install.sh
Which return the following warning:
Warning: /opt/homebrew/bin is not in your PATH.
Instructions on how to configure your shell for Homebrew
can be found in the 'Next steps' section below.
And I checked xcode-select is installed:
#Michaels-MacBook-Air ~ % xcode-select --version
xcode-select version 2396.
I am suspicious his PATH might be wrong:
#Michaels-MacBook-Air ~ % echo $PATH
/usr/local/bin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Keybase.app/Contents/SharedSupport/bin
Is this problematic?
If no, what else could be causing a problem?
From the Homebrew documentation:
This script installs Homebrew to its default, supported, best prefix (/usr/local for macOS Intel, /opt/homebrew for Apple Silicon and /home/linuxbrew/.linuxbrew for Linux)
If your coworker has an M1 or M2 mac, you'll need to add /opt/homebrew/bin to PATH.
To install brew, just run the following script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Homebrew Official Documentation:
https://brew.sh/

Unable to install homebrew in macos

I am trying to install homebrew using command /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" on my mac but I am getting this error:
HEAD is now at aa937b902 Merge pull request #11474 from cho-m/fix-tar-validation.
I'm using zsh and already installed the Xcode using the command xcode-select --install
What can I do to solve the error? Any help is appreciated.

Unable to install jenkins in mac

I am trying to install the Homebrew throwgh following command in Terminal:
brew install jenkins-lts
but the result is: -bash: brew: command not found
what is your recommendation
Sounds like you havent got brew installed, please run the following in a terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
There is further install guidance here: https://docs.brew.sh/Installation if required

Error in running Homebrew on Mac OS X mavericks

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -e:70: warning: Insecure world writable dir /usr in PATH, mode 040777 It appears Homebrew is already installed. If your intent is to reinstall you should do the following before running this installer again: rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
I have this on my terminal but I cant make use of homebrew. I need to use homebrew to install django pyhton web framework. However I don't seem to get the error here. It says its already installed but none of the brew commands work.
ghochee-macbook-pro:logs streamoid$ brew doctor -bash: brew: command not found <<<<<
Can anyone please help? I also see that there is no .bash_profile file with the PATH variable set, am I looking the right folder and file here?
It sounds like /usr/local/bin isn't on your $PATH. You can add it by running the following command in the terminal:
echo 'export PATH="/usr/local/bin:${PATH}"' >> ~/.bash_profile
Then restart your terminal for the changes to take affect.

Error Installing Homebrew - Brew Command Not Found [duplicate]

This question already has answers here:
Installing Homebrew on macOS
(24 answers)
Closed 2 years ago.
I've spent the bulk of my Friday trying to get the latest version of Ruby installed on my new MacBook Air (w/ Mountain Lion installed).
I have all the latest versions of XCode and command line tools. But I can't seem to get Homebrew to work! Here's a screenshot of where I keep getting stuck (I'm a new user, so can't embed this image).
As you can see I used the following to instal Homebrew:
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go/install)"
While there was a "warning" it seemed as though the installation worked:
Warning: /usr/local/bin is not in your PATH.
==> Installation successful!
Despite that, when I try to run "brew doctor" I received the following:
-bash: brew: command not found
Again, I'm trying to install homebrew, so i can instal the latest version of ruby -- I'm looking to learn to code in ruby, but kind of screwed if I can even get a development environment running! :)
The warning is telling you what is wrong. The problem is that brew is kept in /usr/local/bin
So, you can try /usr/local/bin/brew doctor
To fix it permanently alter your bash profile (.bashrc or .profile in your home directory) and add the following line:
export PATH=/usr/local/bin:$PATH
On Apple silicone it's
export PATH=/opt/homebrew/bin/:$PATH
Check XCode is installed or not.
gcc --version
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
brew update
http://techsharehub.blogspot.com/2013/08/brew-command-not-found.html "click here for exact instruction updates"
nano ~/.profile
add these lines:
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
save the file:
Ctrl + X then Y then Enter
then render the changes:
source ~/.profile
This was just happening to me, but none of the suggestions above worked. I changed directories ("cd ~/tmp") and suddenly the command
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
worked for me. Prior to changing directories I had been in a directory that is a Git repository. Perhaps that was interfering with the ruby and Git commands in the Brew install script.
You can run in terminal
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
then install https://github.com/robbyrussell/oh-my-zsh.
When those complate run i.e pico editor pico .zshrc and past those lines:
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
remember use brew doctor :)
try this
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/linuxbrew/go/install)"
You can use this:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
to install homebrew.

Resources