OS X Lion 上 Homebrew 中的错误

OS X Lion 上 Homebrew 中的错误

我刚刚按照安装页面的说明运行了 Homebrew 脚本。然后我brew doctor在终端中运行,它返回了几个错误。我不确定如何修复这些错误,请帮忙。

brew doctor

Error: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:

    /usr/local/share/man/de
    /usr/local/share/man/de/man1
Error: You have Xcode 4.2, which is outdated.
Please install Xcode 4.3.
Error: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libcdt.5.dylib    /usr/local/lib/libcgraph.6.dylib    /usr/local/lib/libgraph.5.dylib    /usr/local/lib/libgvc.6.dylib    /usr/local/lib/libgvpr.2.dylib    /usr/local/lib/libpathplan.4.dylib    /usr/local/lib/libxdot.4.dylib
Error: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/libcdt.pc    /usr/local/lib/pkgconfig/libcgraph.pc    /usr/local/lib/pkgconfig/libgraph.pc    /usr/local/lib/pkgconfig/libgvc.pc    /usr/local/lib/pkgconfig/libgvpr.pc    /usr/local/lib/pkgconfig/libpathplan.pc    /usr/local/lib/pkgconfig/libxdot.pc
Error: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

    2to3

Consider amending your PATH so that /usr/local/bin
is ahead of /usr/bin in your PATH.

答案1

经过多次 Google 搜索和摆弄后,我终于让它启动并运行了。

首先,您需要使用“chown”使目录可写。

sudo chown $(whoami) /usr/local/share/man/de
sudo chown $(whoami) /usr/local/share/man/de/man1

然后从 App Store 安装 Xcode 4.3,并从 Xcode->Preferences->Downloades->Components 安装命令行工具。然后为 Xcode 4.3 设置有效路径。

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

GraphViz 中有一些意外的 dylib 和 .pc 文件。直接删除它们可能是安全的,但我选择备份它们,以防其他应用程序崩溃。要备份它们:

mkdir -p ~/brew-backup/lib/pkgconfig/
mv /usr/local/lib/*.*.dylib ~/brew-backup/lib/
mv /usr/local/lib/pkgconfig/*.pc ~/brew-backup/lib/pkgconfig/

最后,修改系统 PATH 使其/usr/local/bin出现在其他路径之前。

export PATH=/usr/local/bin:/usr/local/sbin:$PATH

运行以下命令检查是否没有其他错误

brew doctor

进行更新brew以使包裹信息保持最新,然后您就可以开始了。

brew update

答案2

一定要备份那些 dylib 和 pc。没有它们会破坏 graphviz(尤其是 python 绑定)。一旦一切就绪,将它们复制回其目录。

如果你忘记备份它们,并且 graphiz 停止工作并出现库上的“未找到图像”错误,只需从网站重新安装 graphviz 应用程序(http://www.graphviz.org/Download_macos.php)。

这里的游戏名称似乎是忽略那些特定的酿酒医生警告。

答案3

我会在这里将文件列入“白名单” .dylib

nano +128 /usr/local/Library/Homebrew/cmd/doctor.rb

添加:

"libcdt.5.dylib", 
"libcgraph.6.dylib", 
"libgraph.5.dylib", 
"libgvc.6.dylib", 
"libgvpr.2.dylib", 
"libpathplan.4.dylib", 
"libxdot.4.dylib", 

以及.pc这里的文件:

nano +163 /usr/local/Library/Homebrew/cmd/doctor.rb

相关内容