LoginSignup
24
18

More than 5 years have passed since last update.

Homebrewがコケた時の対処法

Posted at

HomebrewでComposerをインストールした時に、下記のようなエラーでインストールできなかった。

Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied - /usr/local/lib/php
Error: Permission denied - /usr/local/lib/php

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/local/lib isn't writable.

This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.

You should probably change the ownership and permissions of /usr/local/lib
back to your user account.
  sudo chown -R $(whoami) /usr/local/lib

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:
    freetype
    jpeg
    libpng
    php71
    unixodbc

sudo chown -R $(whoami) /usr/local/lib を実行

24
18
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
24
18