3

I get this error when installing rmagick, I have followed all kind of guides and get the same error every time. This time I have followed this guide: http://www.youtube.com/watch?v=gEWAVlNCKhg&feature=youtu.be :

   C:/Ruby192/bin/ruby.exe extconf.rb --with-opt-include=C:/ImageMagick/Sou
    rceCode --with-opt-lib=C:/ImageMagick
    checking for Ruby version >= 1.8.5... yes
    *** 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=${opt-dir}/include
            --with-opt-lib=${opt-dir}/lib
            --with-make-prog
            --without-make-prog
            --srcdir=.
            --curdir
            --ruby=C:/Ruby192/bin/ruby
    extconf.rb:171:in ``': No such file or directory - convert -version (Errno::ENOE
    NT)
            from extconf.rb:171:in `<main>'


    Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2
    .13.1 for inspection.
    Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/ext/RMagick
    /gem_make.out

    c:\>
Rails beginner
  • 14,321
  • 35
  • 137
  • 257

2 Answers2

4

According to the error:

extconf.rb:171:in ``': No such file or directory - convert -version
(Errno::ENOENT)

it would appear that you don't have Imagemagick (or an equivalent) installed. The main application in the Imagemagick suite is the convert binary. If you're certain you do have it installed, then you should check that it's accessible in the PATH.

WWW
  • 9,734
  • 1
  • 29
  • 33
  • I think it is installed: c:\ImageMagick>convert -version Version: ImageMagick 6.7.6-7 2012-04-20 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC Features: OpenMP – Rails beginner Apr 24 '12 at 21:13
  • 1
    Except you're running ruby from `C:/Ruby192/bin/`. If you're in that directory, what happens when you try to run `convert -version`? – WWW Apr 24 '12 at 21:14
  • Then it is not recognised. c:\Ruby192\bin>convert -version 'convert' blev ikke genkendt som en intern eller ekstern kommando, et program eller en batchfil. – Rails beginner Apr 24 '12 at 21:16
  • 1
    Then you need to add `C:\ImageMagick` to your path. See http://www.windowsitpro.com/article/configuration/how-can-i-add-a-new-folder-to-my-system-path- for how to do that (if you don't already know how). – WWW Apr 24 '12 at 21:18
  • I have added all the varibles in step 3 in this answer still get the same error: http://stackoverflow.com/questions/4451213/ruby-1-9-2-how-to-install-rmagick-on-windows – Rails beginner Apr 24 '12 at 21:27
  • The main test you need to concern yourself with is the one from my first comment on my answer: can you run `convert -version` from `C:\Ruby192\bin\`? If no, then you didn't set your paths correctly. If you can, then triple-check the error to see if you're actually getting the same error. – WWW Apr 25 '12 at 13:11
  • Yes I can do that: C:\Ruby192\bin>convert -version Version: ImageMagick 6.7.6-7 2012-04-20 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC Features: OpenMP But gives a loaderror in the console: C:\Rails\myapp>irb irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'RMagick' LoadError: no such file to load -- RMagick from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i n `require' from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.r – Rails beginner Apr 25 '12 at 17:35
  • You should make a new question for that, as it's a different error. – WWW Apr 25 '12 at 18:10
1

First I thought I should set the environment variables in the system.

But setting these variables in the command view:

set DFImageMagick = C:\ImageMagick
set PATH=%DFImageMagick%;%PATH% (if you don't already have it in PATH)
set CPATH=%DFImageMagick%\include;%CPATH%
set LIBRARY_PATH=%DFImageMagick%\lib;%LIBRARY_PATH%

And then running the command gem install rmagick

And the gem was installed without any errors!

Rails beginner
  • 14,321
  • 35
  • 137
  • 257