130
119

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

phpenv入れてる時brew doctorしたら出るWarning消した

Last updated at Posted at 2014-06-16

brew doctorしたらこんなWarningが出た

$ 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.

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:

    /Users/takc923/.phpenv/shims/php-config

PATH通ってるところに*-configなファイルあったら、./configureスクリプトが自分の設定ファイルと勘違いして事故るかもよ、的な警告っぽい。つまり/Users/takc923/.phpenv/shims/をPATHから外したら直るはず。

とは言えこれをPATHから外すとphpenvが使えなくなる気がするので、brewを実行するときだけ該当のパスを外すようにした。
.zshrcに以下の行を追加。

alias brew="env PATH=${PATH/~\/\.phpenv\/shims:/} brew"

これでbrewコマンドを叩くと、元の$PATHから~/.phpenv/shims:を取り除いたものをPATHに設定した状態で実行される。
この該当パスが$PATHの一番後ろにあると:がなくて正規表現にヒットせずに取り除かれないので注意。

この変数の記法はman zshexpnPARAMETER EXPANSIONの項を参照。

これでWarningが消えた

$ brew doctor
Your system is ready to brew.

参考: http://easyramble.com/homebrew-config-scripts-warning.html

130
119
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
130
119

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?