brew链接错误libpng和libtiff

时间:2015-07-05 03:24:22

标签: macos homebrew elixir

我尝试使用自制软件安装elixir,我收到以下错误

==> Pouring libtiff-4.0.3.yosemite.bottle.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local

文件存在 - / usr / local / lib    错误:文件存在 - / usr / local / lib

我跑了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:

libpng
libtiff

所以我跑了brew link libpng,我得到了这个

Linking /usr/local/Cellar/libpng/1.6.17... Error: File exists - /usr/local/lib

我不知道什么是错的。任何帮助

1 个答案:

答案 0 :(得分:0)

似乎在/usr/local/lib文件夹中,存在libpng个符号,因此brew不想覆盖它们。它是elixir的依赖关系,因此它会停止设置。

如果您使用的是MacPorts或Homebrew或手动安装任何内容,则依赖项可能会发生冲突。最好以互相排斥的方式使用其中一种。

如果您不打算从源代码构建软件包,那么在易用性方面使用Homebrew是可行的选择。

Homebrew不能像你期望的那样工作。默认情况下,它有一个基本目录来安装名为keg的{​​{1}}工件,尽管它是可配置的。通常,您可以将二进制文件复制到Cellar,将库复制到/usr/local/bin,将标头复制到/usr/local/lib等等......但是,Homebrew会将它们安装到自己的目录中并创建符号链接在那些目录上,为了使它们以相同的方式起作用。

您可能会发现/usr/local/include命令出现错误(或不兼容)。它会告诉你符号/文件冲突。您可以手动从文件系统中删除它们,之后brew doctor将创建指向其基本目录的符号链接(在brew命令后)。

实验

当我突然决定在我的计算机上执行一个微不足道的brew link $PACKAGE_NAME时,它会输出一些意想不到的头文件,如下所示:

brew doctor

然而,它还指出,如果一切正常,这些并不重要:

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

输出的前几行:

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!

这不是我的个人计算机,但似乎有人手动将Unexpected header files: /usr/local/include/node/android-ifaddrs.h /usr/local/include/node/ares.h ... 安装到此计算机(实际上是用户)。在这种情况下,尝试通过node安装它或依赖它的任何东西都会失败,因为即将到来的头文件会与预先安装的头文件冲突。