Closed ellardli closed 2 years ago
# I added the following to my .zshrc file, without the comments # export PATH="$PATH:$(brew --prefix)/imagemagick@6/bin" # export PATH="$(brew --prefix)/opt/libpq/bin:$PATH"
If this is all you did: this is not enough.
Can you still reproduce brew doctor
message and PATH
output this in a new shell after installation?
Hey @MikeMcQuaid ! Thanks for that callout. I also added the following to .zshrc
and forgot to add it to the ticket. Adding it now.
export PATH="/opt/homebrew/bin:$PATH"
export PATH="/opt/homebrew/sbin:$PATH"
The brew doctor
and PATH
output is what i'm getting right now after a couple of restarts.
I can reproduce this with:
❯ brew doctor check_user_path_2
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: Homebrew's "bin" was not found in your PATH.
Consider setting your PATH for example like so:
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc
❯ echo $PATH | rg -q ':/usr/local/bin:' && echo "Homebrew bin present"
Homebrew bin present
Oddly, the check_user_path_2
warning does not appear with just brew doctor
.
Edit: Ah, never mind. check_user_path_2
needs to be run after check_user_path_1
in order to work.
What's the output of
brew ruby -e 'require "utils"; puts paths'
?
Output is the following:
$ brew ruby -e 'require "utils"; puts paths'
/opt/homebrew
Ah. Do
unset HOMEBREW_PATH
Use HOMEBREW_PREFIX
if you want an environment variable that refers to /opt/homebrew
.
You also may want to avoid setting anything HOMEBREW_*
that isn't documented in man brew
, as that has the potential to break things.
Hey @carlocab . That fixed it, thank you!
I'd like to understand why unsetting that env variable fixed it, and how you were able to debug that. Now that you've called it out, I do see that the setup scripts that my place has set up does run export HOMEBREW_PATH='/opt/homebrew'
. How were you able to tell that the env variable was set and that it was a problem?
Homebrew copies certain important environment variables into HOMEBREW_
-prefixed ones...unless the latter already exists: https://github.com/Homebrew/brew/blob/721a27d68d63775176567ecba6c4a5b793130618/bin/brew#L76-L88
Because you set HOMEBREW_PATH
, brew
did not copy your existing PATH
, so brew doctor
examined your HOMEBREW_PATH
and went "wait, where's my bin
directory?"
What @gromgit said.
If you need to keep your HOMEBREW_PATH
variable (since you suggested this was something you didn't personally set), you can also do
alias brew="HOMEBREW_PATH= brew"
@gromgit @carlocab I wonder if we should explicitly unset HOMEBREW_PATH
in bin/brew
?
That's probably a good idea. All the "derived" variables listed are either;
HOMEBREW_EDITOR
), or HOMEBREW_TMUX
)except HOMEBREW_PATH
.
@gromgit @carlocab I wonder if we should explicitly unset
HOMEBREW_PATH
inbin/brew
?
I'm not necessarily opposed to it, but this would be a bit like playing whack-a-mole. I recall users having problems from setting other HOMEBREW_*
variables too. I think it was HOMEBREW_PREFIX
.
What @gromgit said.
If you need to keep your
HOMEBREW_PATH
variable (since you suggested this was something you didn't personally set), you can also doalias brew="HOMEBREW_PATH= brew"
We chose to namespace our variable to prevent further collisions. Based on the convo and in retrospect, we should've done that to prevent collisions that we weren't aware of at the time and moving forward.
brew config
outputbrew doctor
outputVerification
brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
I tried running
brew services
to begin to run Redis, and received errors while trying to do so. I then ranbrew doctor
to attempt to debug the cause, which lead me to the bin/sbin PATH error.What happened (include all command output)?
What did you expect to happen?
Based on my $PATH, I would've expected that I wouldn't have received an error about
/opt/homebrew/bin
or/opt/homebrew/sbin
not being in my PATH.Step-by-step reproduction instructions (by running
brew
commands)