読者です 読者をやめる 読者になる 読者になる

matthew as a q.

目標10記事quant

MBPの初期設定 part3.1 brew doctorでのエラーの解決

rbenvでのrubyインストールでエラー出た際に、rbenvをhomebrewで入れたことから、

brew doctor

で、エラー起きてないかチェックした。


5つほど、warning出てた。以下、brew doctor結果。

Warning: /usr/local/lib isn't writable.
This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a brew tries to write a file to this directory, the
install will fail during the link step.

You should probably `chown` /usr/local/lib

Warning: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:

    /usr/local/share/man/de
    /usr/local/share/man/de/man1

Warning: Broken symlinks were found. Remove them with `brew prune`:
  /usr/local/share/ghostscript/9.07/Resource/Font/xylubt12.pfb
  /usr/local/share/ghostscript/9.07/Resource/Font/xylubt11.pfb
  /usr/local/share/ghostscript/9.07/Resource/Font/xylubt10.pfb
  ...途中省略


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:

    jpeg
    libtiff

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:

    emacsclient
    etags

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
  • 上から2つは同じように対処。(

osx - What does "You should probably `chown` them" mean? - Stack Overflow

sudo chown mmatthew_43 /usr/local/lib

残りも同じようにした。

  • 3つ目

Warning: Broken symlinks were found. Remove them with `brew prune`:
シンボリックリンク壊れてるから、brew pruneで取り除け)

brew prune
  • 4つ目

後々、挙げられているkegsにリンクが貼られてないことで、build-troubleとか起こるかも。

brew link jpeg
brew link libtiff

これらのコマンドは、はじめにやった/usr/local/libとかのfileのownershipの修正をしないと、動かない。

  • 5つ目

もともと入ってるものが、Homebrew経由で入れたものの代わりに利用されてしまってるから、先に/usr/local/binを見るように設定する。

echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile

を打ち込んで、.bash_profileにパスの設定を書き込む。

c.f.「.bash_profile」=ターミナル立ち上げた時に読み込まれる設定ファイル。もし、.bashrcに設定を書く人なら、書き込む先を.bashrcにしてもいい。

以上で、

$ brew doctor
Your system is ready to brew.

エラー解消できた。