2014-11-03 66 views
0

我的Rmagic Gem停止工作。所以我試圖重新安裝所有的東西,讓它再次運行。在win8上安裝Rmagic/ImageMagic

到目前爲止我所做的步驟。

下載不同的版本與

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 

試圖安裝

創業板安裝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>' 

回答

0

重新安裝和嘗試以下的版本爲我工作

Ruby 1.9.3 
ImageMagic 6.6.7-0 Q15 

我也跑了這個命令,它成功地安裝rmagic

gem install rmagick --platform=ruby -- --with-opt-dir=C:\RailsInstaller\ImageMagick