LoginSignup
79
62

More than 3 years have passed since last update.

pyenv をインストールしてると brew doctor で出る Warning を消す方法

Last updated at Posted at 2016-10-28

pyenv をインストールしてると brew doctor で下記のような Warning が出る。それを消す方法をメモっとく。

$ brew doctor
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 and just ignore them. 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 what 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/takuya/.pyenv/shims/python-config
  /Users/takuya/.pyenv/shims/python3-config
  /Users/takuya/.pyenv/shims/python3.5-config
  /Users/takuya/.pyenv/shims/python3.5m-config

端的に言えば PATH 環境変数に /Users/takuya/.pyenv/shims のように pyenv のディレクトリが含まれてしまうのが原因。Homebrew を実行するときにだけ PATH 環境変数に pyenv のディレクトリが含まれない形にしてあげればいい。

ということで、brew コマンドのエイリアスを下記のように .bash_profile あたりで設定すれば解決する。参考にしたサイトでは置換してるけど、Homebrew 実行時に参照したい PATH 環境変数をベタに書く方法でいいかと。phpenv などを入れたときも修正が要らないだろうし。

alias brew="PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin brew"

参考文献

http://www.task-notes.com/entry/20141223/1419324649
http://qiita.com/takc923/items/45386905f70fde9af0e7

79
62
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
79
62