Homebrew春の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 or file an issue; just ignore this. Thanks!

Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or
https://developer.apple.com/download/more/.


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:
  /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7-config
  /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config
  /Library/Frameworks/Python.framework/Versions/3.7/bin/python3-config

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libtcl8.6.dylib
  /usr/local/lib/libtk8.6.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/fakemysql.h
  /usr/local/include/fakepq.h
  /usr/local/include/fakesql.h
  /usr/local/include/itcl.h
  /usr/local/include/itcl2TclOO.h
  /usr/local/include/itclDecls.h
  /usr/local/include/itclInt.h
  /usr/local/include/itclIntDecls.h
  /usr/local/include/itclMigrate2TclCore.h
  /usr/local/include/itclTclIntStubsFcn.h
  /usr/local/include/mysqlStubs.h
  /usr/local/include/odbcStubs.h
  /usr/local/include/pqStubs.h
  /usr/local/include/tcl.h
  /usr/local/include/tclDecls.h
  /usr/local/include/tclOO.h
  /usr/local/include/tclOODecls.h
  /usr/local/include/tclPlatDecls.h
  /usr/local/include/tclThread.h
  /usr/local/include/tclTomMath.h
  /usr/local/include/tclTomMathDecls.h
  /usr/local/include/tdbc.h
  /usr/local/include/tdbcDecls.h
  /usr/local/include/tdbcInt.h
  /usr/local/include/tk.h
  /usr/local/include/tkDecls.h
  /usr/local/include/tkPlatDecls.h

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
  /usr/local/lib/pkgconfig/tcl.pc
  /usr/local/lib/pkgconfig/tk.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
  /usr/local/lib/libtclstub8.6.a
  /usr/local/lib/libtkstub8.6.a

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  php

```

対処法を自分用にメモ。
あくまで対処する文言しか書いてないので原因は参考にした先人のQiitaの記事を見るべし。

#Warning: A newer Command Line Tools release is available.

`brew --config`でCLTのバージョンを確認してから[More Downloads for Apple Developers](https://developer.apple.com/download/more/)からdmg版のCLTを導入する。


#Warning: "config" scripts exist outside your system or Homebrew directories.

```zsh
❯ echo 'alias brew="env PATH=${PATH/\/Library\/Frameworks\/Python\.framework\/Versions/3\.7/bin:/} brew"' >> .zprofile
```
ターミナルを再起動。

#Warning: Unbrewed dylibs were found in /usr/local/lib.

```zsh
❯ rm -rf /usr/local/lib/libtcl8.6.dylib
❯ rm -rf /usr/local/lib/libtk8.6.dylib
```

#Warning: Unbrewed header files were found in /usr/local/include.

びっくりするほど力技

```zsh
❯ sudo rm -rf /usr/local/include/fakemysql.h
❯ sudo rm -rf /usr/local/include/fakepq.h
❯ sudo rm -rf /usr/local/include/fakesql.h
❯ sudo rm -rf /usr/local/include/itcl.h
❯ sudo rm -rf /usr/local/include/itcl2TclOO.h
❯ sudo rm -rf /usr/local/include/itclDecls.h
❯ sudo rm -rf /usr/local/include/itclInt.h
❯ sudo rm -rf /usr/local/include/itclIntDecls.h
❯ sudo rm -rf /usr/local/include/itclMigrate2TclCore.h
❯ sudo rm -rf /usr/local/include/itclTclIntStubsFcn.h
❯ sudo rm -rf /usr/local/include/mysqlStubs.h
❯ sudo rm -rf /usr/local/include/odbcStubs.h
❯ sudo rm -rf /usr/local/include/pqStubs.h
❯ sudo rm -rf /usr/local/include/tcl.h
❯ sudo rm -rf /usr/local/include/tclDecls.h
❯ sudo rm -rf /usr/local/include/tclOO.h
❯ sudo rm -rf /usr/local/include/tclOODecls.h
❯ sudo rm -rf /usr/local/include/tclPlatDecls.h
❯ sudo rm -rf /usr/local/include/tclThread.h
❯ sudo rm -rf /usr/local/include/tclTomMath.h
❯ sudo rm -rf /usr/local/include/tclTomMathDecls.h
❯ sudo rm -rf /usr/local/include/tdbc.h
❯ sudo rm -rf /usr/local/include/tdbcDecls.h
❯ sudo rm -rf /usr/local/include/tdbcInt.h
❯ sudo rm -rf /usr/local/include/tk.h
❯ sudo rm -rf /usr/local/include/tkDecls.h
❯ sudo rm -rf /usr/local/include/tkPlatDecls.h
```

#Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.

```zsh
❯ rm -rf /usr/local/lib/pkgconfig/tcl.pc
❯ rm -rf /usr/local/lib/pkgconfig/tk.pc
```


#Warning: You have unlinked kegs in your Cellar.

```zsh
❯ brew unlink php
❯ rm -drf /usr/local/Cellar/php/
❯ brew cleanup
```

#Warning: Unbrewed static libraries were found in /usr/local/lib.

```zsh
❯ rm -rf /usr/local/lib/libtclstub8.6.a
❯ rm -rf /usr/local/lib/libtkstub8.6.a
```

#結果

```zsh
❯ brew doctor
Your system is ready to brew.
```
![gembaneko.jpeg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/293758/09d6eef8-538e-dbd1-2520-d72c685ed22f.jpeg)

基本的に`Unexpected (以下略)`だったら以下のファイルを消せばいいっぽい。


#参考にしたサイト

https://qiita.com/gesutaka/items/fe34bd5de524a20b2b0a

https://qiita.com/ponsuke0531/items/7ede97f6abe6129802c1

https://qiita.com/rinimaruranran/items/2d8d930ad846fa41b9e6

https://qiita.com/haruu_11113/items/c0dfefdd1b65afa8105e

https://qiita.com/haruu_11113/items/0bdde67f17b60e4fb657