Thursday, December 9, 2010

If you fail Install RMagick on MinGW and MSYS...

If you fail phosphorescence: Install RMagick on MinGW and MSYS, it may be the reason that convert command in extconf.rb file is overloaded with Windows File System's one. So edit the gems/rmagick-2.13.1/ext/RMagick/extconf.rb file at #171 and #178 like below:
`identify -version` =~ /Version: ImageMagick (\d+\.\d+\.\d+)-\d+ /

Then let's type the command in gems/rmagick-2.13.1 directory.
> gem build rmagick.gemspec
> gem install rmagick-2.13.1.gem --platform=ruby -- --with-opt-lib=c:/ImageMagick/6.6.6-Q16/lib --with-opt-include=c:/ImageMagick/6.6.6-Q16/include

And Now I'm requesting pulling it.

23 comments:

zrr said...

Youhei-sama

This seems to work for me. I just trying to install on Ruby 1.9.2 on Windows-Vista.

Yes, seems to work! Thanks!

Best
Zeno

Unknown said...

I've been trying to get RMagick on my Windows install and this post has gotten me closer than anything else, but it's still not there. Have you ever seen this error?

C:/Ruby192/bin/ruby.exe extconf.rb --with-opt-lib=c:/ImageMagick-6.6.7-Q16/lib --with-opt-include=c:/ImageMagick-6.6.7-Q
16/include

checking for Ruby version >= 1.8.5... yes
...
checking for AcquireImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h...
no
... (Many other no and yes)

======================================================================
Sat 12Feb11 03:42:50
This installation of RMagick 2.13.1 is configured for
Ruby 1.9.2 (i386-mingw32) and ImageMagick 6.6.7
======================================================================



make
C:/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_RMagick2'" > RMagick2-i386-mingw32.def
make: *** No rule to make target `/C/Ruby192/include/ruby-1.9.1/ruby.h', needed by `rmagick.o'. Stop.

Youhei Kondou said...

Please check you have installed header files
http://4.bp.blogspot.com/_Gc38Wa77_EY/TJ3Um4HiT6I/AAAAAAAAAPA/-s3e2F7tx8k/s1600/imagemagick_installer.png

Anonymous said...

Hi Youhei,

After updated the extconf.rb as you said I am still getting this problem when I try that last command line:

> gem install rmagick-2.13.1.gem --platform=ruby -- --with-opt-lib=c:/Program Files (x86)/ImageMagick-6.6.9-Q16/lib --with-opt-include=c:/Program Files (x86)/ImageMagick-6.6.9-Q16/include

Temporarily enhancing PATH to include DevKit
Building native extensions. This could take a while
ERROR: Error installing rmagick-2.13.1.gem:
ERROR: Failed to build gem native extension

C:Ruby192/bin/ruby.exe extconf.rb --with-opt-lib=c:/Program Files (x86)/ImageMagick-6.6.9-Q16/lib --with-opt-include=c:/Program Files (x86)/ImageMagick-6.6.9-Q16/include
checking for Ruby version >= 1.8.5... yes
*** extconf.rb failed ***

extconf.rb.171:in ''':No such file or directory - identify -version (Errno::ENT) from extconf.rb:171:in ''

Anonymous said...

Hi Youhei, btw, I reinstalled ImageMagick to the C:/Ruby192 folder (rather than 'Program Files (x86)' which had a space in the name) and I am still getting the same error. Please help!

Thanks

Youhei Kondou said...

You should not include white space in ImageMagick path. Plz check my previous post from top sentence of this article.

Anonymous said...

Hi Youhei, I changed the directory of file and now the command is:

>gem install rmagick-2.13.1.gem --platform=ruby -- --with-opt-lib=c:/ImageMagick-6.6.9-Q16/lib --with-opt-include=c:/ImageMagick-6.6.9-Q16/include

And it is still not working. I get:
ERROR: Error installing rmagick-2.13.1.gem:
ERROR: Failed to build gem native extension

Checking for Ruby version>= 1.8.5... yes
*** extconf.rb failed ***

lower down I get the line:
extconf.rb:171:in ''': No such file or directory - identify -version (Errno::ENOENT)
from extconf.rb:171:in '(main)'

Anonymous said...

Thanks Youhei, got it to work now. Thanks!

Duke of Earl said...

Hey I am having the same problem as da33a6fe what was the solution that you gave him to finally get it to work ?

Youhei Kondou said...

Plz check my previous post from top sentence of this article.
http://phosphor-escence.blogspot.com/2010/10/install-rmagick-on-mingw-and-msys.html
I guess you should check PATH

Daniel Connolly said...

Hi I was following the http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/ guide to installing rmagick and this one and everything seemed to work there but when i tried to fire up my rails server i'm getting the error CORE_RL_magick_.dll is missing. Can anybody help with this? The file is there and my paths are all set to whatever they are in the link above.

Youhei Kondou said...

As like in http://phosphor-escence.blogspot.com/2010/10/install-rmagick-on-mingw-and-msys.html, set the PATH for ImageMagick install root.

Youhei Kondou said...

I now recommend that all you should use mini_magick rather than RMagick, see my past article. http://phosphor-escence.blogspot.com/2011/11/minimaick-better-rmagick-alternative.html

Anonymous said...

thx. looks like it solved my problem!
(Though I installed ImageMagick to the default "Program Files (x86)" folder, it worked using the Progra~2 short form. )
{:-D

Anonymous said...

You can get rmagick to compile on Windows with the command:

gem install rmagick -- '--with-opt-dir="[path to ImageMagick]"'

There are three noteworthy things about this command:

1. There's a double-dash separating "rmagick" and the --with-opt-dir option
2. The --with-opt-dir option is surrounded by single-quotes
3. The path to the ImageMagick directory is surrounded by double-quotes

You can have spaces in the path to the ImageMagick directory if you use this syntax.

You also have to make sure of two other things:

1. ImageMagick was installed with the development headers option (installs lib and include directories)
2. ImageMagick is first in your system path

If ImageMagick isn't first in your system path, you'll get an "Invalid drive specification" error when extconf.rb tries to identify the ImageMagick version.

All that said, I've experienced failures to build with some version pairings of rmagick and ImageMagick. I was able to get ImageMagick 6.7.7 and rmagick 2.13.0 to build together on both Windows 7 and Server 2003.

Anonymous said...

Think I meant 2.13.1 on the rmagick gem.

DantaliaN said...

install ImageMagic. Path without spaces. Exampl C:/ImageMagick-6.8.3-Q16

unzip RMagic anywhere


in \RMagick-2.12.0\ext\RMagick\extconf.rb
rem on line 150
#abort "Unable to get ImageMagick version" unless $1
and set ani version
$magick_version = "ImageMagick 6.8.3"


gem install rmagick-2.12.0.gem --platform=ruby -- --with-opt-lib=C:/ImageMagick-6.8.3-Q16/lib --with-opt-include=C:/ImageMagick-6.8.3-Q16/include

Tim said...

Hi I am still getting the same error as the guys above in relation to

extconf.rb:171:in ``': No such file or directory - identify -version (Errno::ENO
ENT)
from extconf.rb:171:in `'

How to solve it ?

Youhei Kondou said...

Type identify in your command prompt.

If there is no ImageMagick itself or there is another identify command, please install ImageMagick itself correctly.

capu said...

@DantaliaN's comment help me install rmagick successfully.
Thank DantaliaN!

seenu said...

Thx a lot this tutorial helped me to install it in 10mins, when i spent around hours & was not able to install.

Unknown said...

Thank you, this worked for me!
Cheers

Games world said...

Such a wonderful information blog post on this topic provides assignment service at affordable cost in a wide range of subject areas for all grade levels, we are already trusted by thousands of students who struggle to write their academic papers and also by those students who simply want Assignment helpto save their time and make life easy.
Ruby assignment help

Post a Comment