使用ImageMagick进行Brew链接

时间:2012-08-09 07:46:07

标签: ruby-on-rails macos imagemagick homebrew rmagick

安装: ostaptan:~ostap $ brew install imagemagick --disable-openmp --from-source

==> Downloading http://downloads.sf.net/project/machomebrew/mirror/ImageMagick-6.7.7-6.tar.bz2
Already downloaded: /Library/Caches/Homebrew/imagemagick-6.7.7-6.tar.bz2
==> Patching
patching file configure
Hunk #1 succeeded at 32371 (offset 447 lines).
==> ./configure --disable-osx-universal-binary --without-perl --prefix=/usr/local/Cellar/imagemagick/6.7.7-6 --enable-shared --disable-static
==> make install
Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link imagemagick'
==> Summary
/usr/local/Cellar/imagemagick/6.7.7-6: 1388 files, 32M, built in 61 seconds

在安装中链接错误后进行链接:

ostaptan:wand ostap $ brew link imagemagick

Linking /usr/local/Cellar/imagemagick/6.7.7-6...

Error: Could not symlink file: /usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/wand/wand-view.h

Target /usr/local/include/ImageMagick/wand/wand-view.h already exists. You may need to delete it.

To force the link and delete this file, do:
  brew link -f formula_name

To list all files that would be deleted:
  brew link -n formula_name

如何链接?该怎么办??无法在任何地方找到答案!

3 个答案:

答案 0 :(得分:11)

如brew链接输出中所示,请尝试

brew link -f imagemagick

这应该清除/usr/local/include/ImageMagick/中的旧链接,然后链接完成安装所需的文件。

如果这不起作用,请检查您的用户是否有权写入/usr/local/include/ImageMagick/*

答案 1 :(得分:1)

经过几个小时的尝试后,唯一对我有用的是:

sudo brew link --overwrite imagemagick

(同样需要/usr/local/bin/brewchownedroot

答案 2 :(得分:0)

Homebrew不再支持overwrite sudo命令。

sudo brew link --overwrite imagemagick

错误:以root身份运行Homebrew非常危险,不再受支持。 由于Homebrew不会放弃安装权限,所以你会给予所有权限 构建脚本对系统的完全访问权限。