问题
I'm following https://ninenines.eu/docs/en/cowboy/2.0/guide/getting_started/
which requires make. When I run the install scripts, the prompt tells me to use make 4.1 . I run brew install erlang git homebrew/dupes/make
then brew unlink make && brew link make
but which make
is still /usr/bin
and make -v
is 3.8.
How do I link to the correct, updated make?
EDIT
export PATH=/usr/local/bin:$PATH is the first line of my ~/.bash_profile
回答1:
You need to set your PATH
so that /usr/local/bin
is ahead of, i.e. before /usr/bin
because homebrew puts its binaries in /usr/local/bin
.
So, for a one-off command, you can run:
/usr/local/bin/make -v
but in general, you want to set your PATH
in your $HOME/.profile
or in $HOME/.bash_profile
like this:
export PATH=/usr/local/bin:$PATH
In general, you will need to source your profile:
source ~/.profile
or log out and log back in again after changing it for it to take effect.
来源:https://stackoverflow.com/questions/40871732/using-gnu-make-4-x-on-osx