概要
Homebrewのbrew doctorで”Warning: "config" scripts exist outside your system or Homebrew directories.”が出たので,解決した.
状況
$ brew doctor
で診断したら,エラーがたくさんでた.
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.
Warning: Unbrewed dylibs were found in /usr/local/lib.
Warning: Unbrewed header files were found in /usr/local/include.
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
....
- Warning:unbrewedは,「homebrewの管理下ではないファイルがあるから,消してね」という意味.無視してもあまり影響はないらしい.確認したところ,消したら色々問題が出そうなファイルばかりなので,ひとまず放置しておく.
- Warning: "config"・・・は,「Homebrewの管理してないconfigファイルがあるよ.大丈夫?」という意味.トラブルの原因になりそうなので,なんとかする.
- 問題になったパスは
/anaconda3/bin/(ファイル名)
- 実際に
$ echo ${PATH}
でパスを確認したら,「/anaconda3/bin:/」が先頭にいた.
- 問題になったパスは
手順
1. $ vi ~/.bash_profile
で,bashの設定ファイルである.bash_profile
を編集可能にする.
※bashの起動時に読み込むのが「.bash_profile」で,画面生成時に読み込むのが「.bashrc」だそうで,自分は「.bash_profile」を使うことにしている.
2. .bash_profile
に次の文を挿入.
alias brew="env PATH=${PATH/\/anaconda3\/bin:/} brew"
※viの編集方法を忘れた場合は,viの基本的な使い方を参照.
3. .bash_profile
を保存する.
4. ターミナルを再起動後$ brew doctor
して,問題の解決を確認
※ $ source ~/.bash_profile
では,設定が反映されなかった.なぜだろう...
参考資料
- phpenv入れてる時brew doctorしたら出るWarning消した. https://qiita.com/takc923/items/45386905f70fde9af0e7
- .zshrcの編集をミスって激しく焦るの巻Add Star. http://d.hatena.ne.jp/seinzumtode/20120106/1325860901
- 【Homebrew】brew doctorのWarning対処方法 (その3) + envコマンドについて. http://www.task-notes.com/entry/20141223/1419324649
- パスを追加したい~.bashrc編~. http://www.itmedia.co.jp/help/tips/linux/l0284.html
- viの基本的な使い方. https://rat.cis.k.hosei.ac.jp/article/rat/serverliteracy/2004/vi.html