ruby和rails中的rmagick安装出错

时间:2021-01-16 07:34:01

Hiall,

大家好,

I am new to ROR . I am trying to install rmagick on my local machine . When I try to install it everytime i get the following error : Please help me out with this situation .

我是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

Thanks in advance

提前致谢

Surjan

Surjan

1 个解决方案

#1


1  

You're missing a header file.

你错过了一个头文件。

It looks like you're on Windows, right?

看起来你在Windows上,对吗?

If so, a simple solution may be to download the pre-built ImageMagick binary for Windows.

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

http://www.imagemagick.org/script/binary-releases.php?ImageMagick=rdfgqvr16sq8ngvahkosd26om0#windows

http://www.imagemagick.org/script/binary-releases.php?ImageMagick=rdfgqvr16sq8ngvahkosd26om0#windows

If you're on Debian or Ubuntu:

如果您使用的是Debian或Ubuntu:

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

(Editors, feel free to add solutions for other platforms)

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

#1


1  

You're missing a header file.

你错过了一个头文件。

It looks like you're on Windows, right?

看起来你在Windows上,对吗?

If so, a simple solution may be to download the pre-built ImageMagick binary for Windows.

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

http://www.imagemagick.org/script/binary-releases.php?ImageMagick=rdfgqvr16sq8ngvahkosd26om0#windows

http://www.imagemagick.org/script/binary-releases.php?ImageMagick=rdfgqvr16sq8ngvahkosd26om0#windows

If you're on Debian or Ubuntu:

如果您使用的是Debian或Ubuntu:

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

(Editors, feel free to add solutions for other platforms)

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