How to Modify Path For Homebrew

How to modify PATH for Homebrew?

open your /etc/paths file, put /usr/local/bin on top of /usr/bin

$ sudo vi /etc/paths

and Restart the terminal, @mmel

How can I permanently add Homebrew to my PATH?

Create/open the ~/.zshrc file and add this line to it: export PATH=$PATH:/opt/homebrew/bin

Installing homebrew and getting the PATH correct (permanently)

Can you type this on the terminal?

/usr/bin/ruby -e "$(curl -fsSL"

The re-installation should fix the PATH.

which brew

Cannot update PATH to accommodate Homebrew commands

By running /opt/homebrew/bin/brew doctor as noted in the warning as opposed to brew doctor I was given the correct notation for updating my .zshrc file export PATH="/opt/homebrew/bin:$PATH as opposed to export PATH=/usr/local/bin:$PATH as indicated in several answers to similar questions. After running source ~/.zshrc and brew doctor the system confirmed the path had been updated properly.

Changing the Homebrew Apache PATH variable

I found the answer here.

To change Apache environment variables when Apache was installed with Homebrew, edit the homebrew.mxcl.httpd24.plist file located in /usr/local/Cellar/httpd24/your version of Apache/.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<!-- add this -->
<!-- end add -->

Then restart Apache.

Getting a warning when installing homebrew on MacOS Big Sur (M1 chip)

I had the same issue today, on Mac OS Big Sur (with M1 chip).
The problem is indicated in the warning : Warning: /opt/homebrew/bin is not in your PATH. It seems that it is the directory where the binaries of hombrew are put.
To resolve, you can do :

  1. Edit your ~/.zshrc or ~/.bashrc with at the end of file:
export PATH=/opt/homebrew/bin:$PATH

After this, tap source ~/.zshrc in your terminal or restart it.

For more infos about the current status of Homebrew on Mac with a M1 chip :
Apple Silicon support in Homebrew

Edit :
As mentioned by @kangkyu in this comment, Homebrew is changing to version 3.0.0 which supports officially Apple Silicon. If you have a prior version just brew update.

Related Topics

Leave a reply