brew doctorしたらエラーが出た

久しぶりにbrew doctorしたらエラーが出た。
どうにか解決。
その際の作業メモ。

```
brew doctor
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:

    mongodb24

Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

    screen

Consider setting your PATH so that /usr/local/bin
occurs before /usr/bin. Here is a one-liner:
    echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile
Error: Failed to import: allegro4
No available formula for allegro4 
Error: Failed to import: boost149
undefined method `deprecated_option' for Boost149:Class
Error: Failed to import: doxygen1831
undefined method `deprecated_option' for Doxygen1831:Class
Error: Failed to import: elasticsearch12
Unsupported special dependency :java
Error: Failed to import: elasticsearch13
Unsupported special dependency :java
Error: Failed to import: elasticsearch14
Unsupported special dependency :java
Error: Failed to import: erlang-r13
undefined method `deprecated_option' for ErlangR13:Class
Error: Failed to import: erlang-r15
undefined method `deprecated_option' for ErlangR15:Class
Error: Failed to import: erlang-r16
undefined method `deprecated_option' for ErlangR16:Class
Error: Failed to import: gcc43
undefined method `deprecated_option' for Gcc43:Class
Error: Failed to import: gcc44
undefined method `deprecated_option' for Gcc44:Class
Error: Failed to import: gcc45
undefined method `deprecated_option' for Gcc45:Class
Error: Failed to import: gcc46
undefined method `deprecated_option' for Gcc46:Class
Error: Failed to import: gcc47
undefined method `deprecated_option' for Gcc47:Class
Error: Failed to import: gcc49
undefined method `deprecated_option' for Gcc49:Class
Error: Failed to import: go12
undefined method `deprecated_option' for Go12:Class
Error: Failed to import: hdf4
undefined method `deprecated_option' for Hdf4:Class
Error: Failed to import: hive010
Unsupported special dependency :java
Error: Failed to import: hive011
Unsupported special dependency :java
Error: Failed to import: jenkins-lts
Unsupported special dependency :java
Error: Failed to import: ledger26
undefined method `deprecated_option' for Ledger26:Class
Error: Failed to import: llvm35
undefined method `deprecated_option' for Llvm35:Class
Error: Failed to import: maven32
Unsupported special dependency :java
Error: Failed to import: mysql51
undefined method `deprecated_option' for Mysql51:Class
Error: Failed to import: mysql55
undefined method `deprecated_option' for Mysql55:Class
Error: Failed to import: node010
undefined method `deprecated_option' for Node010:Class
Error: Failed to import: node04
undefined method `deprecated_option' for Node04:Class
Error: Failed to import: node06
undefined method `deprecated_option' for Node06:Class
Error: Failed to import: node08
undefined method `deprecated_option' for Node08:Class
Error: Failed to import: postgresql8
undefined method `deprecated_option' for Postgresql8:Class
Error: Failed to import: postgresql9
undefined method `deprecated_option' for Postgresql9:Class
Error: Failed to import: postgresql91
undefined method `deprecated_option' for Postgresql91:Class
Error: Failed to import: postgresql92
undefined method `deprecated_option' for Postgresql92:Class
Error: Failed to import: postgresql93
undefined method `deprecated_option' for Postgresql93:Class
Error: Failed to import: solr14
Unsupported special dependency :java
Error: Failed to import: solr36
Unsupported special dependency :java
Error: Failed to import: solr4
Unsupported special dependency :java
Error: Failed to import: subversion16
undefined method `deprecated_option' for Subversion16:Class
Error: Failed to import: subversion17
undefined method `deprecated_option' for Subversion17:Class

Warning: Your Homebrew is outdated.
You haven't updated for at least 24 hours, this is a long time in brewland!
To update Homebrew, run `brew update`.
```

ので、とりあえず

```
brew link
brew update
```
してみた。

```
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: 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:

    mongodb24

Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

    screen

Consider setting your PATH so that /usr/local/bin
occurs before /usr/bin. Here is a one-liner:
    echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc

Warning: Your Xcode (5.1.1) is outdated
Please update to Xcode 6.2.
Xcode can be updated from the App Store.
```

Xcodeをアップデートしろというエラーがでたので、アップデート。
再び brew 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 and just ignore them. Thanks!

Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

    screen

Consider setting your PATH so that /usr/local/bin
occurs before /usr/bin. Here is a one-liner:
    echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc
Error: Failed to import: ab
No available formula for ab 
```

↓で.zshrcにexport PATH="/usr/local/bin:$PATH"を追加
```
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc
```

.zshrcを読み込み
```
source ~/.zshrc
```

またまた、brew doctor
```
brew doctor
Error: Failed to import: ab
No available formula for ab 
```

なので、
```
brew cleanup
brew tap --repair
```

そしてまたまたbrew doctor
```
brew doctor      
Your system is ready to brew.
```

解決！

それぞれのコマンドについてはまた別でまとめます！