Install Rmagic / ImageMagic on win8

扶醉桌前 提交于 2019-12-13 21:12:31

问题


My Rmagic gem stopped working. So i am attempting to re-install everything to get it working again.

The steps I have done so far.

Downloaded different versions to test with

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

Installed in a path without any spaces

"C:\RailsInstaller\ImageMagick"

Installed with path and header settings ticked

Opened cmd with admin access and ran

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

tried to install

gem install rmagick

I get the error message

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:


after re-installing and trying the following version worked for me

Ruby 1.9.3
ImageMagic 6.6.7-0 Q15

I also ran this command which installed rmagic successfully

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


来源:https://stackoverflow.com/questions/26710821/install-rmagic-imagemagic-on-win8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!