OS X Lion上的Homebrew错误


18

我只是按照安装页面中的描述运行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.

Answers:


27

经过大量谷歌搜索和摆弄,我设法使其启动并运行。

首先,您需要使用“ 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/

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

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

通过运行检查是否没有更多错误

brew doctor

更新brew以使软件包信息保持最新,您就可以开始使用。

brew update

根据我的经验,您可以放心地忽略大多数brew doctor错误,除非您确实无法安装某些东西。
slhck 2012年

1
但是,这些目录不应该归root拥有吗?
Blacklight Shining 2012年

复制并粘贴所有目录,并通过以下方式将其设置为变量:directorys =“ PASTE HERE”。回声“ $目录” | 边读边;回显“ $ line”;sudo chown $(whoami)“ $ line”; 回声; 完成
Jared Burrows

3

绝对备份那些dylib和pc。没有它们会破坏graphviz(尤其是python绑定)。设置完成后,将它们复制回其目录。

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

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


1

我会在.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

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.