pyenvをインストールするとbrewコマンドでwarningが出るときの対処法

pyenvをインストールするとbrewコマンドで警告が表示されときの対処法です

pyenvをインストールするとbrewコマンドで以下のような警告が表示されます

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: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Users/user/.pyenv/shims/python3.10-config
  /Users/user/.pyenv/shims/python3.9-config
  /Users/user/.pyenv/shims/python-config
  /Users/user/.pyenv/shims/python3-config

このWarningは以下のエイリアスを設定すると解消します

alias brew="env PATH=${PATH//$(pyenv root)\/shims:/} brew"

「.bashrc」もしくは「.zshrc」に追記しておきましょう

即時に反映させるにはsourceコマンドを忘れずに

例)% source .zshrc