Help us understand the problem. What is going on with this article?

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

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

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした