1

大家好,

我是 ROR 的新手。我正在尝试在我的本地机器上安装 rmagick。当我每次尝试安装它时都会出现以下错误:请帮助我解决这种情况。

D:\ruby\bin>gem install rmagick  --platform=ruby -- --with-opt-lib=D:\ruby\Rmmagik\lib --with-opt-include=D:\ruby\Rmmagik\include   Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
ERROR: Failed to build gem native extension.

D:/ruby/bin/ruby.exe extconf.rb --with-opt-lib=D:\ruby\Rmmagik\lib --with-opt-include=D:\ruby\Rmmagik\include
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no

Can't install RMagick 2.13.1. Can't find MagickWand.h.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
 --with-opt-dir
 --without-opt-dir
 --with-opt-include=${opt-dir}/include
 --with-opt-lib=${opt-dir}/lib
 --with-make-prog
 --without-make-prog
 --srcdir=.
 --curdir
 --ruby=D:/ruby/bin/ruby
Gem files will remain installed in D:/ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1 for inspection.
Results logged to D:/ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out

提前致谢

苏尔扬

4

1 回答 1

1

你缺少一个头文件。

看起来你在 Windows 上,对吧?

如果是这样,一个简单的解决方案可能是为 Windows 下载预构建的 ImageMagick 二进制文件。

关联

如果您使用的是 Debian 或 Ubuntu:

sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev

(编辑们,请随意添加其他平台的解决方案)

于 2012-04-06T06:18:41.720 回答