LoginSignup
4
2

More than 5 years have passed since last update.

Homebrewのエラー

Posted at

Homebrewでローカル環境にPHPを設定しようとするとerrorが発生

$ 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:
  python@2

brew doctorすると 'brew link'しろと書いてあって
these: python@2 となっているのでbrewで管理しているpython@2のリンクがおかしくなっているみたい…
とりあえずエラーに従う

brew link python@2 実行

またしてもエラー

Linking /usr/local/Cellar/python@2/2.7.14_3... Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

permission deniedエラーで/usr/local/Frameworksが無いと言われてる。(dir_s_mkdir - /usr/local/Frameworks)
実際のパスを見にいくとFrameworksディレクトリがないので言われた通り作成する

#Frameworksディレクトリを作成
sudo mkdir /usr/local/Frameworks

#パスワード入力
Password:XXXXXXXX

再びbrew link実行

brew link python@2

#同じエラーになった
Linking /usr/local/Cellar/python@2/2.7.14_3... Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks/Python.framework

どうやら権限をつける必要性があるみたい

sudo chown $(whoami):admin /usr/local/Frameworks
brew link python@2実行

#結果
Linking /usr/local/Cellar/python@2/2.7.14_3... 5 symlinks created

お、brew link出来たみたい?

brew doctor

#結果
Your system is ready to brew.

とりあえずエラーは消えた!

4
2
0

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
4
2