0

I am trying to install all ruby gems ion windows for redmine. Everytime I am getting below exception

C:\xampp\htdocs\dev-ruby\redmine>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:/xampp/ruby/RailsInstaller/Ruby2.2.0/bin/ruby.exe extconf.rb
*** 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
--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:/xampp/ruby/RailsInstaller/Ruby2.2.0/bin/$(RUBY_BASE_NAME)
extconf.rb:141:in ``': No such file or directory - identify -version (Errno::ENOENT)
from extconf.rb:141:in `configure_compile_options'
from extconf.rb:16:in `initialize'
from extconf.rb:548:in `new'
from extconf.rb:548:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in C:/xampp/ruby/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rmagick-2.16.0 for inspection.
Results logged to C:/xampp/ruby/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/rmagick-2.16.0/gem_make.out
Max
  • 18,333
  • 4
  • 38
  • 54

2 Answers2

0

rmagick is just a wrapper for ImageMagick. extconf.rb is checking for the presence of ImageMagick by running identify, which is one of the programs provided by ImageMagick. It isn't finding it, hence the No such file or directory message.

You need to install ImageMagick and make sure that its executables are in your path.

Make sure that in the same place you run gem install rmagick you can also run identify -version successfully.

Max
  • 18,333
  • 4
  • 38
  • 54
  • Thanks Max, I have already installed ImageMagick can you please also share how can I set the executables – Arpit Gupta Nov 09 '16 at 12:01
  • See http://stackoverflow.com/questions/9546324/adding-directory-to-path-environment-variable-in-windows – Max Nov 09 '16 at 15:24
  • Hello Max, environment variables are already set and I have installed ImageMagick at c:/ImageMagick, Still facing the same issue – Arpit Gupta Nov 10 '16 at 06:11
  • Try running ImageMagick commands from the same shell doing the rmagick installation. It could be that whatever is doing the gem installation doesn't have the same path. – Max Nov 10 '16 at 20:17
  • 1
    Thanks Max, can you please also tell me the commands i need to use for running imagmagick on shell. – Arpit Gupta Nov 15 '16 at 07:02
  • The binaries I have are `animate,compare,composite,conjure,convert,display,identify,import,mogrify,montage,stream`. – Max Nov 15 '16 at 16:17
  • Please can you complete your answer to explain how to solve the issue? – Sergio A. Nov 06 '19 at 11:03
  • @SergioA. there are any number of reasons why ImageMagick might not be found by Ruby. It depends not only on how you installed ImageMagick, but how you installed Ruby. I can't give a single answer that will resolve the problem for everyone. Ask a separate question with more specific details and you might get help – Max Nov 06 '19 at 13:46
  • Sorry @Max, I now understand all these tricky combinations needed to get RMagick ready to work. For anyone feeling a bit lost like i did, i recommend this link which helped me solve my issue: https://medium.com/ruby-on-rails-web-application-development/install-rmagick-gem-on-windows-7-8-10-imagemagick-6-9-4-q16-hdri-5492c3fef202 – Sergio A. Nov 07 '19 at 11:48
0

This topic is kind of hard to solve, due to the problems with ImageMagick can be caused by any number of reasons.

For anyone feeling a bit lost like i did, i recommend this link which helped me solve my issue: https://medium.com/ruby-on-rails-web-application-development/install-rmagick-gem-on-windows-7-8-10-imagemagick-6-9-4-q16-hdri-5492c3fef202

Sergio A.
  • 182
  • 1
  • 9