在win8上安装Rmagick / ImageMagick

时间:2014-11-03 09:01:08

标签: ruby-on-rails rmagick

我的Rmagic宝石停止了工作。所以我试图重新安装所有东西以使其再次运行。

到目前为止我所做的步骤。

下载了不同的版本以便

进行测试
ImageMagick-6.6.7-0-Q16-windows-dll.exe
ImageMagick-6.8.9-8-Q16-x64-dll.exe
ImageMagick-6.8.9-9-Q16-x64-dll.exe

安装在没有任何空格的路径中

"C:\RailsInstaller\ImageMagick"

安装了路径和标题设置已打勾

enter image description here

使用管理员权限打开cmd并运行

set CPATH=C:/RailsInstaller/ImageMagick/include
set LIBRARY_PATH=C:/RailsInstaller/ImageMagick/lib

尝试安装

gem install rmagick

我收到错误消息

C:\Sites\website>gem install rmagick                           
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.

C:/RailsInstaller/Ruby2.0.0/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.

C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/mkmf.rb:431:in `try_do': The compiler failed to      generate an executable file. (RuntimeError)
    You have to install development tools first.
    from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/mkmf.rb:562:in `try_cpp'
    from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/mkmf.rb:1041:in `block in have_header'
    from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/mkmf.rb:892:in `block in checking_for'
    from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/mkmf.rb:337:in `block (2 levels) in postpone'
    from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/mkmf.rb:307:in `open'
    from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/mkmf.rb:337:in `block in postpone'
    from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/mkmf.rb:307:in `open'
    from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/mkmf.rb:333:in `postpone'
    from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/mkmf.rb:891:in `checking_for'
    from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/mkmf.rb:1040:in `have_header'
    from extconf.rb:186:in `<main>'

1 个答案:

答案 0 :(得分:0)

重新安装并尝试以下版本为我工作

Ruby 1.9.3
ImageMagic 6.6.7-0 Q15

我还运行了这个成功安装rmagic的命令

gem install rmagick --platform=ruby -- --with-opt-dir=C:\RailsInstaller\ImageMagick
相关问题