无法在 Yosemite 上安装 Homebrew:/usr/local/lib 已经存在

Can't install Homebrew on Yosemite: /usr/local/lib already exists

我第一次尝试在 Yosemite 上安装 Homebrew。我选择通过终端安装,尽管我不是这方面的专家。然后这件事发生了:

-e:161: warning: Insecure world writable dir /usr/local in PATH, mode 040777
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/lib

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/lib
Password:

然后我输入了我的密码。然后发生了这样的事情:

mkdir: /usr/local/lib: Not a directory
Failed during: /usr/bin/sudo /bin/mkdir -p /usr/local/lib

当我检查我的 /usr/local/ 目录时,已经有一个名为 lib.

的文件

This is a screen-capture of my /usr/local/ directory.

我似乎无法用它安装 Homebrew。谁能给我下一步的建议?非常感谢。

好吧,你至少需要暂时重命名 /usr/local/lib,因为它不属于 homebrew 并且挡路了:

sudo mv /usr/local/lib /usr/local/oldlib