why is the terminal tool reporting brew not found but brew is working.

why is the terminal tool reporting brew not found but brew is working.

avatar

bash: brew: command not found
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
(base) bash-3.2$ arch
arm64
(base) bash-3.2$

   1   │ if [[ "$(uname)" == "Darwin" ]]; then

   2   │   alias sed="/opt/homebrew/bin/gsed"

   3   │   alias awk="/opt/homebrew/bin/gawk"

   4   │ else

   5   │   alias sed='sed'

   6   │   alias awk='awk'

   7   │ fi

   8   │ shopt -s expand_aliases

   9   │

  10   │ [[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]] && . "/opt/homebrew/etc/profile.d/bash_completion.sh"

  11   │

  12   │ if [ -f ~/.git-completion.bash ]; then

  13   │   . ~/.git-completion.bash

  14   │ fi

  15   │

  16   │

  17   │ if [ "$(arch)" = "arm64" ]; then

  18   │   eval $(/opt/homebrew/bin/brew shellenv);

  19   │ else

  20   │   eval $(/usr/local/bin/brew shellenv);

  21   │ fi

  22   │

  23   │ if [ "$(arch)" = "arm64" ]; then

  24   │ # >>> conda initialize >>>

  25   │ # !! Contents within this block are managed by 'conda init' !!

  26   │ __conda_setup="$('/opt/homebrew/Caskroom/miniforge/base/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"

  27   │ if [ $? -eq 0 ]; then

  28   │     eval "$__conda_setup"

  29   │ else

  30   │     if [ -f "/opt/homebrew/Caskroom/miniforge/base/etc/profile.d/conda.sh" ]; then

  31   │         . "/opt/homebrew/Caskroom/miniforge/base/etc/profile.d/conda.sh"

  32   │     else

  33   │         export PATH="/opt/homebrew/Caskroom/miniforge/base/bin:$PATH"

  34   │     fi

  35   │ fi

  36   │ unset __conda_setup

  37   │ # <<< conda initialize <<<

  38   │ fi

  39   │

  40   │

  41   │ if [ "$(arch)" != "arm64" ]; then

  42   │ # >>> conda initialize >>>

  43   │ # !! Contents within this block are managed by 'conda init' !!

  44   │ __conda_setup="$('/usr/local/Caskroom/miniforge/base/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"

  45   │ if [ $? -eq 0 ]; then

  46   │     eval "$__conda_setup"

  47   │ else

  48   │     if [ -f "/usr/local/Caskroom/miniforge/base/etc/profile.d/conda.sh" ]; then

  49   │         . "/usr/local/Caskroom/miniforge/base/etc/profile.d/conda.sh"

  50   │     else

  51   │         export PATH="/usr/local/Caskroom/miniforge/base/bin:$PATH"

  52   │     fi

  53   │ fi

  54   │ unset __conda_setup

  55   │ # <<< conda initialize <<<

  56   │ fi

  57   │

  58   │ export COPYFILE_DISABLE=true

  59   │

  60   │ export PDSH_SSH_ARGS_APPEND="-q  -o StrictHostKeyChecking=no"

All Comments (1)

avatar

Hi
The reason why some commands are not found in the terminal tool is because the PATH variable along with other environment variables are inherited from the context of RDM which does not have access to all the environment that the macOS terminal has. As of now, we don't know how we can prevent this.

But there's a work around:
edit the file .zshrc to add the line:
source ~/.zprofile

The next time you'll open the terminal tool, it should be ok.

Denis Vincent