我不能在Windows上安装rmagickgem

我用ruby1.9.2和轨道3.0.3。 我试图安装rmagickgem,但是当我运行bundle install我得到一个错误告诉我:

 Installing rmagick (2.12.1) with native extensions c:/Ruby192/lib/ruby/site_ruby /1.9.1/rubygems/installer.rb:529:in `rescue in block in build_extensions': ERROR : Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) c:/Ruby192/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:/Ruby192/bin/ruby c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to genera te an executable file. (RuntimeError) You have to install development tools first. from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp' from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:834:in `block in have_header' from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for' from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postp one' from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open' from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone' from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open' from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone' from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for' from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:833:in `have_header' from extconf.rb:171:in `<main>' Gem files will remain installed in c:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2 .12.1 for inspection. Results logged to c:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2.12.1/ext/RMagick /gem_make.out from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:507:in `b lock in build_extensions' from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `e ach' from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `b uild_extensions' from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:156:in `i nstall' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/sour ce.rb:96:in `install' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/inst aller.rb:55:in `block in run' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec _set.rb:12:in `block in each' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec _set.rb:12:in `each' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec _set.rb:12:in `each' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/inst aller.rb:44:in `run' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/inst aller.rb:8:in `install' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/cli. rb:226:in `install' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend or/thor/task.rb:22:in `run' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend or/thor/invocation.rb:118:in `invoke_task' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend or/thor.rb:246:in `dispatch' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend or/thor/base.rb:389:in `start' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/bin/bundle:13:in `<top (required)>' from c:/Ruby192/bin/bundle:19:in `load' from c:/Ruby192/bin/bundle:19:in `<main>' 

我从http://rubyinstaller.org/downloads/安装了开发工具包和最新版本的ImageMagick。 我试图设置rmagickconfiguration(lib和包括目录),但我仍然得到相同的错误

任何帮助? 任何想法来解决这个问题?

Solutions Collecting From Web of "我不能在Windows上安装rmagickgem"

先决条件:
Ruby> 1.8.6
DevKit(任何版本)
没有其他ImageMagick安装或PATH条目

第1步:安装ImageMagick:

下载ImageMagick: http : //imagemagick.spd.co.il/binaries/ImageMagick-6.8.0-3-Q16-windows-dll.exe

安装ImageMagick:
*重要说明:安装路径不应包含任何空格。
理想情况下选择“C:\ ImageMagick”

请确保选择以下选项:

将应用程序目录添加到路径系统中
为C和C ++安装开发头文件和库

第2步:安装rmagick:

使用以下命令安装rmagick gem:

 gem install rmagick --platform=ruby -- --with-opt-lib=c:/ImageMagick/lib --with-opt-include=c:/ImageMagick/include 

通过-

http://shoobm.wordpress.com/2013/01/03/installing-rmagick-gem-on-windows-7/

我有同样的问题 ,我的环境是:

 windows XP (x32) ruby 1.9.3p484 (2013-11-22) [i386-mingw32] DevKit-tdm-32-4.5.2-20111229-1559-sfx ImageMagick-6.8.8-2-Q8-x64-static.exe 

ImageMagick从v6.8.8重新安装到6.6.7后,我成功安装了rmagik gem。 这只是一个不兼容版本的问题…

使用rmagick-win32 gem,它不需要单独的ImageMagick。 这是捆绑的。

请看看: http : //rmagick.rubyforge.org/install-faq.html#win

请参阅RubyInstaller组中的此线程 ,该组指向我们的教程页面 ,您可以在其中找到描述安装方法的博客文章 。

首先清理你的路径环境变量。 (这是人们经常跳过的主要步骤,但非常重要)。 这是你面临的错误的主要原因。

然后从这里安装rails安装程序(2.0.0): http : //railsinstaller.org/en

它会设置红宝石,铁轨和其他所有你需要的东西。 这也将为您设置您的环境路径变量。

接下来安装imagemagick 6.7.9.9或更低版本,并安装时选中包含C头的选项。 确保将其安装在rails安装程序文件夹中。

然后在你的命令提示符下输入: path=c:\RailsInstaller\ImageMagick-6.7.9-Q8;%path%或者你有的任何版本。

然后键入

 gem install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6.7.9-Q8"' 

最后编辑C:\ RailsInstaller \ Ruby2.0.0 \ setup_environment.bat以包含ImageMagic的路径

在第25行: SET PATH=c:\RailsInstaller\ImageMagick-6.7.9-Q8; 或者你有什么版本