LoginSignup
1
2

More than 3 years have passed since last update.

Homebrewで「Warning: "config" scripts exist outside your system or Homebrew directories ・・・」とエラーが出た際の解消法

Last updated at Posted at 2019-07-02

1.環境

PC : mac
OS : macOS Mojava バージョン10.14.4
Homebrew : バージョン 2.1.6
anacondaを使用中

2. エラーが出るコマンドの例

brew doctor

これは、インストール問題をチェックするコマンドです。
※ その他にもエラーの出るコマンドはあるかもしれません。そこまで確認出来ていません。ごめんなさい。

3. エラーの出力部分

username$ 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 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:
 /anaconda3/bin/icu-config
 /anaconda3/bin/krb5-config
 /anaconda3/bin/freetype-config
 /anaconda3/bin/xslt-config
 /anaconda3/bin/libpng16-config
 /anaconda3/bin/python3.7-config
 /anaconda3/bin/libpng-config
 /anaconda3/bin/xml2-config
 /anaconda3/bin/python3.7m-config
 /anaconda3/bin/python3-config
 /anaconda3/bin/curl-config
 /anaconda3/bin/ncursesw6-config
 /anaconda3/bin/pcre-config

4. 解決策

今回のエラーの場合
1. ターミナルを起動

2. 現在ユーザのホームディレクトリに移動
ターミナルに以下のコマンドを入力

cd ~

2. 今回の場合「.bash_profile 」ファイルの末尾に「alias brew="env PATH=${PATH/\/anaconda3\bin:/} brew"」を追記

echo 'alias brew="env PATH=${PATH/\/anaconda3\bin:/} brew"' >> ~/.bash_profile 

※1 「alias brew="env PATH=${PATH/\/anaconda3\/bin:/} brew"」の${PATH/\/anaconda3\/bin:/}の部分は適宜自分のエラーが出ているフォルダに変更してください。 今回の場合、「3. エラー出力の部分」の下の方を見ました。

※2 ${PATH/\/anaconda3\/bin:/}は、PATH/anaconda3/binと言う文字列を空文字に置き換えています。
※3 \(バックスラッシュ)は文字列の /(スラッシュ)が置換記法の/(スラッシュ)と認識されないようにつけています。

--ご意見をいただき一部修正しました--
${FOO/xxx/yyy} は環境変数 FOO に含まれる文字列 xxx を文字列 yyy に置き換えるという意味です。ここでは PATH に含まれる文字列 /anaconda3/bin: を空文字列に置き換えています。

5. 参考文献

TASK NOTES | 【Homebrew】brew doctorのWarning対処方法 (その3) + envコマンドについて
cBlog | HomebrewとAnacondaの相性の悪さについて
ようへいの日々精進XP | Bash で変数内の文字列を置換するショートメモ

1
2
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
1
2