如何使用自制软件安装imagemagick?

时间:2011-08-13 23:41:48

标签: git gcc homebrew osx-lion gcc4

我正在尝试在OSX Lion上安装Imagemagick但是有些东西没有按预期工作。

-> brew install imagemagick

/usr/local/git/bin/git
==> Cloning https://github.com/adamv/ImageMagick.git
Cloning into /Users/klebershimabuku/Library/Caches/Homebrew/imagemagick--git...
fatal: https://github.com/adamv/ImageMagick.git/info/refs not found: did you run git      update-server-info on the server?
Error: Failure while executing: git clone --depth 1 https://github.com/adamv/ImageMagick.git /Users/kleber/Library/Caches/Homebrew/imagemagick--git
brew医生说:

-> brew doctor
We couldn't detect gcc 4.0.x. Some formulae require this compiler.

Some "config" scripts were found in your path, but not in system or Homebrew folders.

`./configure` scripts often look for *-config scripts to determine if software packagesare installed, and what additional flags to use when compiling and linking.

Having additional scripts in your path can confuse software installed via Homebrew if the config script overrides a system or Homebrew provided script of the same name.

/Users/kleber/.rvm/gems/ruby-1.9.2-p180@global/bin
passenger-config

Setting DYLD_LIBARY_PATH can break dynamic linking.
You should probably unset it.

是的,我安装并运行了XCode 4.1。

-> brew update
From http://github.com/mxcl/homebrew
* branch            master     -> FETCH_HEAD
Already up-to-date.

6 个答案:

答案 0 :(得分:147)

你可以尝试:

brew update && brew install imagemagick

答案 1 :(得分:80)

对我来说最快的解决方法是:

cd /usr/local
git reset --hard FETCH_HEAD

然后我重试brew install imagemagick并正确地从新镜像中取出包,而不是adamv。

如果不起作用,请确保/Library/Caches/Homebrew不包含任何imagemagick文件或文件夹。如果有的话,删除它们。

答案 2 :(得分:55)

brew install imagemagick

如果您想将pdf转换为图片,请不要忘记安装gs这是一个依赖项:

brew install ghostscript

答案 3 :(得分:2)

在这里回答旧的线程问题(有点题外话),因为这是我在搜索如何在Mac OS上安装Image Magick以便在本地Web服务器上运行时发现的。仅仅安装Imagemagick是不够的。您还必须PECL安装它,以便加载PHP模块。

来自this SO answer

brew install php
brew install imagemagick
brew install pkg-config
pecl install imagick

您可能需要sudo apachectl restart。然后在您的网络服务器上运行的简单php脚本中检查phpinfo()

如果仍然不存在,则可能是在同一Mac上运行多个版本的PHP(一个是通过命令行,一个是通过Web服务器)运行的。解决该问题超出了此答案的范围,但是有一些不错的选择。

答案 4 :(得分:0)

遇到类似的错误并通过在 brew update 之前运行 brew install imagemagick 修复

答案 5 :(得分:-14)

你可以这样做:

brew reinstall php55-imagick

php55是你的PHP版本。