在Mac OS X 10.8上安装GraphicsMagick

27
我正试图在Mountain Lion上安装GraphicsMagick,但遇到了问题。我尝试了所有在博客和其他stackoverflow问题中搜索到的方法,但都没有起作用。因此,我把每个命令得到的完整错误堆栈放在这里,请查看并帮助我解决。
当我运行:
brew install graphicsmagick

我明白了

Warning: Could not link jpeg. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link jpeg'

并且

Warning: Could not link libpng. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link libpng'

最后,我得到了以下结果:

==> make install
Warning: Could not link graphicsmagick. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link graphicsmagick'

Possible conflicting files are:
==> Summary
  /usr/local/Cellar/graphicsmagick/1.3.18: 283 files, 10M, built in 52 seconds

现在,如果我尝试brew link jpegbrew link libpng,我会得到这个错误

Linking /usr/local/Cellar/jpeg/8d... Warning: Could not link jpeg. Unlinking...

Error: Could not symlink file: /usr/local/Cellar/jpeg/8d/bin/wrjpgcom
Target /usr/local/bin/wrjpgcom already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
  brew link --overwrite formula_name

To list all files that would be deleted:
  brew link --overwrite --dry-run formula_name
如果我尝试使用brew link --overwrite jpeg的覆盖方法,它可以工作。但是'brew link --overwrite libpng'会得到以下结果。
Linking /usr/local/Cellar/libpng/1.5.14... Warning: Could not link libpng. Unlinking...

Error: Permission denied - /usr/local/share/man/man5/png.5

之后,当我尝试运行brew link graphicsmagick时,我收到以下提示:

Linking /usr/local/Cellar/graphicsmagick/1.3.18... Warning: Could not link graphicsmagick. Unlinking...

Error: Could not symlink file: /usr/local/Cellar/graphicsmagick/1.3.18/share/man/man5/quantize.5
/usr/local/share/man/man5 is not writable. You should change its permissions.

请帮忙,谢谢!


1
brew doctor 命令会告诉你什么? - Cedric Han
1个回答

41

尝试清除所有内容,然后重新开始:

brew uninstall imagemagick graphicsmagick libpng jpeg
brew cleanup -s
brew install graphicsmagick

最近帮我解决了一些问题


12
如果您仍然遇到权限错误,请运行“sudo chown -R $USER:admin /usr/local”。 - joet3ch
感谢提供在Mac上安装GraphicsMagick的语法。这个安装包括PHP扩展吗?我正在尝试在应用程序中访问,但出现了“Class 'GMagick' not found”的错误。 - zeros-and-ones

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接