I have the same problem. Using Ruby 2.0.0p247 and gem 2.0.7 with ImageMagick 6.8.6
I tried with 32-bit and 64-bit version of ImageMagick. In both cases, the terminal output is the same:
$ gem install rmagick --platform=ruby -- --with-opt-dir=/c/ImageMagick64 Temporarily enhancing PATH to include DevKit... Building native extensions with: '--with-opt-dir=c:/ImageMagick64' This could take a while... ERROR: Error installing rmagick: ERROR: Failed to build gem native extension. c:/Ruby200-x64/bin/ruby.exe extconf.rb --with-opt-dir=c:/ImageMagick64 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 --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:/Ruby200-x64/bin/ruby c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to ge nerate an executable file. (RuntimeError) You have to install development tools first. from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:561:in `try_cpp' from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1040:in `block in have_header ' from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:891:in `block in checking_for ' from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:336:in `block (2 levels) in p ostpone' from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:306:in `open' from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:336:in `block in postpone' from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:306:in `open' from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:332:in `postpone' from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:890:in `checking_for' from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1039:in `have_header' from extconf.rb:194:in `<main>' Gem files will remain installed in c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rmagi ck-2.13.2 for inspection. Results logged to c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/ext/RMa gick/gem_make.out
However, when I use the 32-bit version, the mkmf.log file gives me an error for both CORE_RL_magick_.lib AND X11.lib (incompatible version). When I use the 64-bit version, I get the error X11.lib.
This makes me think that X11.lib is bad, maybe the 32-bit version included in their distribution.
My mkmf.log file looks like this:
checking for Ruby version >= 1.8.5... -------------------- yes -------------------- "x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -Ic:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -Ic:/Ruby200-x64/include/ruby-2.0.0 -I. -Ic:/ImageMagick64/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -Lc:/Ruby200-x64/lib -Lc:/ImageMagick64/lib -L. -lCORE_RL_magick_ -lX11 -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi " c:/ruby200-x64/rubydevkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/ImageMagick64/lib/X11.lib when searching for -lX11 c:/ruby200-x64/rubydevkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/ImageMagick64/lib/X11.lib when searching for -lX11 c:/ruby200-x64/rubydevkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/ImageMagick64/lib\X11.lib when searching for -lX11 c:/ruby200-x64/rubydevkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lX11 collect2.exe: error: ld returned 1 exit status checked program was: /* begin */ 1:
I know that this does not necessarily answer the question, but I was able to get a stone built using the 32-bit version of ruby ββwith the 32-bit ImageMagick library - this is "Just Works"
source share