在Windows 7上安装RMagick Error以使用Ruby创建映像

时间:2014-01-24 13:31:31

标签: ruby-on-rails ruby rmagick

我想安装ImageMagick。我正在使用Windows 7,因为我想用Ruby创建一个图像,但是当我在使用Git Bash屏幕命令时使用命令gem install rmagick时,我收到了这个错误

c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for stdint.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
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=c:/RailsInstaller/Ruby1.9.3/bin/ruby
c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
    from extconf.rb:194:in `<main>'

2 个答案:

答案 0 :(得分:0)

为windows c c ++ extensions http://rubyinstaller.org/add-ons/devkit/

安装dev-kit

答案 1 :(得分:0)

盖伊 最后,我得到了在Windows 7上安装它的真正方法

1-在路径C中安装ImageMagick-6.7.9-0-Q16-windows-static.exe:/ ImageMagic
2-在路径C中安装ImageMagick-6.7.9-0-Q16-windows-dll.exe:/ ImageMagic
3-解压缩文件夹中的ImageMagick-6.8.8-2.tar并将其重命名为SourceCode,然后将其设置在路径C:/ ImageMagic / SourceCode中 4-在路径C:/ MinGW中安装mingw-get-setup.exe 5-为用户定义环境变量
路径 - C:\ MinGW \ bin;

6-使用命令(gem install rmagick - ' - with-opt-dir =“C:/ ImageMagick”')
7 - 打开Gemfile并设置(gem'rmagick')
8 - 键入命令(bundle-install)

你可以关注这篇文章 https://github.com/rmagick/rmagick/wiki

错误发生在我身上,因为我安装了ImageMagick版本6.8