Help us understand the problem. What is going on with this article?

HomebrewでdoctorしたらWarning: "config" scripts exist outside your system or Homebrew directories.となった時の対応方法

More than 1 year has passed since last update.

事象:brew doctorしたら警告が出た。

doctorしたら出た警告
$ 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 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 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:
  /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m-config
  /Library/Frameworks/Python.framework/Versions/3.6/bin/python3-config
  /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config

対応:.bash_profileにHomwbrewのエイリアスを追加する。

ターミナルで実行
echo 'alias brew="env PATH=${PATH/\/Library\/Frameworks\/Python\.framework\/Versions/3\.6/bin:/} brew"' >> .bash_profile

ターミナルを再起動する。

原因:Homebrew管理外のconfigファイルがあると衝突するかもしれないと心配されている。

Homebrewの管理外な*-configファイルがあると衝突おこすかも
【Homebrew】brew doctorのWarning対処方法 (その3) + envコマンドについて - TASK NOTES

そういえばPythonは、Homebrewを使わないでインストールした。
MacにPython3をインストールする方法 - ponsuke_tarou’s blog

「PATHの中に追加の(config)スクリプトがあると、Homebrewでインストールされるソフトウェアを混乱させるかもよ。もし、そのconfigスクリプトが、システムやHomebrewで供給される同じ名前のスクリプトを上書きした場合にはね。」
Warning: “config” scripts exist outside your system or Homebrew directories. brew doctor 時の警告 | EasyRamble

PATHを確認してみる
$ echo $PATH
/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/opt/postgresql@9.6/bin:/usr/local/Cellar/ant/1.10.0/libexec/bin:/usr/local/bin:/usr/local/sbin:/Users/mana/.nodebrew/current/bin:/Users/mana/bin/Sencha/Cmd/6.0.2.14/..:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

# 犯人はこれらしい↓
# /Library/Frameworks/Python.framework/Versions/3.6/bin:

対応後

$ brew doctor
Your system is ready to brew.
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away