Home ruby RMagick on Ruby 1.9.1 (i386-mingw32) Work !!! :D [UPDATE]
formats

RMagick on Ruby 1.9.1 (i386-mingw32) Work !!! :D [UPDATE]

Published on February 12, 2010 by WaYdotNET in ruby, tips

RMagick on Ruby 1.9.1 (i386-mingw32) Work !!! :D
Ispirate from :
installing rmagick with mingw and ruby 1.9
and
http://groups.google.com/group/rubyinstaller/browse_thread/thread/c837c4438d91208b
but , on my laptop don’t work….

With Windows 7 work well:

Step 1: DOWNLOAD

1
2
3
4
5
1) Ruby => http://rubyforge.org/frs/download.php/74298/rubyinstaller-1.9.2-p180.exe
2) DevKit => http://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe
3) ImageMagick => http://www.imagemagick.org/download/binaries/ImageMagick-6.6.7-9-Q16-windows-dll.exe
4) RMagick => https://github.com/rmagick/rmagick/zipball/master
5) type-windows.xml => http://www.imagemagick.org/source/type-windows.xml

Step 2: Install

1
2
3
4
5
1) Ruby => c:\Ruby192
2) DevKit => c:\DevKit
3) ImageMagick => c:\ImageMagick-6.6.7-Q16 [WITH HEADER !!!!!!!]
3.a) Replace c:\ImageMagick-6.6.7-Q16\config\type-ghostscript.xml  with type-windows.xml
4) RMagick => c:\rmagick-rmagick

Step 3: Set Enviroment variable

1
2
3
1) PATH = C:\Ruby192\bin;C:\ImageMagick-6.6.7-Q16
2) CPATH = C:\ImageMagick-6.6.7-Q16\include
3) LIBRARY_PATH = C:\ImageMagick-6.6.7-Q16\lib

Step 4: Configure DevKit
(from https://github.com/oneclick/rubyinstaller/wiki/Development-Kit)

1
2
3
4
1) cd c:\DevKit
2) ruby dk.rb init
3) ruby dk.rb install
4) C:\DevKit\devkitvars.bat (THANKS TO Joachim  => http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/#comment-86618621)

Step 5: Compile RMagick

1
2
3
4
1) run C:\DevKit\msys.bat
2) cd /c/rmagick-rmagick
3) ruby setup.rb
4) ruby setup.rb install

Step 6: Check

1
2
3
4
5
6
1) ruby -v
        ruby 1.9.2p180 (2011-02-18) [i386-mingw32]
2) identify --version
    Version: ImageMagick 6.6.7-9 2011-02-21 Q16 http://www.imagemagick.org
	Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
	Features: OpenMP

If you experience problems concerning “extconf.rb”, you should try:
http://phosphor-escence.blogspot.com/2010/12/if-you-fail-install-rmagick-on-mingw.html
from
http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/#comment-166014708

http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/#comment-317551623


In my case :
1) Install Ruby 1.9.1 (i386-mingw32) from http://www.rubyinstaller.org/, direct link

2) Install Development Kit (DevKit) from http://www.rubyinstaller.org/addons.html, direct link

3) Install ImageMagick 6.5.6-8-Q8 from http://www.imagemagick.org , direct link with header !!!!

4) Download Rmagick from source : http://github.com/rmagick/rmagick , direct link or git clone git://github.com/rmagick/rmagick.git

5) Replace !ImageMagick Path!\config\type-ghostscript.xml with

http://www.imagemagick.org/source/type-windows.xml

 

 

6) Set enviroment variable :
set CPATH=!ImageMagick Path!\include
set LIBRARY_PATH=!ImageMagick Path!\lib
set PATH=!ImageMagick Path!
[EDIT]
set PATH = !ruby_path!\bin
set PATH = !ruby_path!\devkit\msys\1.0.11\bin
set PATH = !ruby_path!\devkit\gcc\3.4.5\bin
[EDIT]
7) run “ruby setup.rb” [EDIT] from msys.bat ( !ruby_path!\devkit\msys\1.0.11\msys.bat ) [EDIT]

 

8) run “ruby setup.rb install” or “gem build *.gemspec” and “gem install *.gem”

9) Enjoy :D

identify –version
Version: ImageMagick 6.5.6-8 2009-10-03 Q8 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

 

ruby -v
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]

Many thanks to :
Rmagick staff => http://rmagick.rubyforge.org/
rogerdpack => http://betterlogic.com
Alexey Borzenkov => not have link, sorry
Luis Lavena => http://blog.mmediasys.com
RubyInstaller => http://www.rubyinstaller.org
RubyInstaller Group => http://groups.google.com/group/rubyinstaller
puts WaYdotNET => Carlo Bertini

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
  • http://www.waydotnet.com WaYdotNET

    Error test:

    File: Info.rb
    Failed: test_depth(Info_UT) [Info.rb:130]: Exception raised: <#>.
    Test crash : test_monitor

    File: Image3.rb
    Failed: test_profile! (Image3.rb:47)
    Test crash: test_write =>
    f = File.new(“test.0″, “w”)
    @img.write(f) { self.format = “JPEG” }
    f.close
    img = Magick::Image.read(‘test.0′)
    assert_equal(“JPEG”, img.first.format)
    FileUtils.rm(‘test.0′)]

    File ImageList2.rb
    Failure: test_from_blob(ImageList2_UT) [ImageList2.rb:110]

    Test Crash:
    test_write =>
    f = File.new(“test.0″, “w”)
    @ilist.write(f) { self.format = “JPEG” }
    f.close
    list = Magick::ImageList.new(‘test.0′)
    assert_equal(“JPEG”, list.format)
    FileUtils.rm(‘test.0′)

  • Alex

    Hello, Carlo!

    Just repeated your steps and it’s actually work! Great! Now I can use rmagick with rubu 1.9.1 under windows. Thank you!

  • http://www.waydotnet.com WaYdotNET

    @Alex : :D Well!

  • http://topsy.com/trackback?utm_source=pingback&utm_campaign=L1&url=http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/ Tweets that mention puts WaYdotNET => Carlo Bertini » RMagick on Ruby 1.9.1 (i386-mingw32) Work !!! :D [UPDATE] — Topsy.com

    [...] This post was mentioned on Twitter by waydotnet. waydotnet said: RMagick on Ruby 1.9.1 (i386-mingw32) Work http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/ [...]

  • http://betterlogic.com/roger/?p=2186 installing rmagick with mingw and ruby 1.9 « Roger's woze

    [...] by puts WaYdotNET => Carlo Bertini » RMagick on Ruby 1.9.1 (i386-mingw32) Work !!! :D — February 12, 2010 @ 9:29 [...]

  • http://betterlogic.com/roger roger

    Why do you need the http://www.imagemagick.org/source/type-windows.xml instead? Shouldn’t imagemagick have come with that?

  • http://www.waydotnet.com WaYdotNET

    If i use normale type-ghostscript.xml, it doesn’t compile because it doesn’t find the right font. to bypass this problem (in my laptop) i have replaced it with the xml file for windows (type-windows.xml )

  • http://betterlogic.com/roger roger

    Interesting. Mine seems to compile with the default set, so perhaps something has changed since then…

  • http://www.waydotnet.com WaYdotNET

    Ruby 1.9.2p0 WORK !

  • worrawut

    I did it with my 1.9.1 on Windows.
    Many thanks !

  • http://www.agilejavaoop.com Abder-Rahman

    The “direct link” of:

    1) Install Ruby 1.9.1 (i386-mingw32) from http://www.rubyinstaller.org/, direct link

    Seems to give the same as (3)

  • http://www.agilejavaoop.com Abder-Rahman

    How can I perform this step?

    5) Replace !ImageMagick Path!\config\type-ghostscript.xml with http://www.imagemagick.org/source/type-windows.xml

    In other words, where should I do those changes? Is that in an .rb file?

    Thanks.

  • http://www.agilejavaoop.com Abder-Rahman

    @Abder-Rahman

    Oh, I think it is in the imageMagick path? I mean, I will find type-ghostscript.xml in the ImageMagick path? There is nothing to do with .rb files here, right?

  • http://www.waydotnet.com WaYdotNET

    Abder sorry for later… :D
    thx 4 found error link :D

    5 step:
    http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/#comment-613
    physically replace the file type-ghostscript.xml with type-windows.xml
    (es: c:\program files\ImageMagick\config\type-windows.xml replace with http://www.imagemagick.org/source/type-windows.xml )

    my english now is very very bad :D

  • Joachim

    I did the following on Windows 7, 64bit, and it worked (all additional packages installed in c:\opt):

    Download:
    http://image_magick.veidrodis.com/image_magick/binaries/ImageMagick-6.6.4-4-Q16-windows-dll.exe
    http://files.rubyforge.vm.bytemark.co.uk/rmagick/RMagick-2.13.1.tar.bz2

    set CPATH=c:\opt\ImageMagick-6.6.4-Q16\include
    set LIBRARY_PATH=c:\opt\ImageMagick-6.6.4-Q16\lib
    path %PATH%;c:\opt\ImageMagick-6.6.4-Q16
    C:\opt\devkit\devkitvars.bat

    ruby -v
    ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

    (It was installed using the latest ruby 1.9.2.p0 installer and devkit http://www.rubyinstaller.org/news/2010/08/23/rubyinstaller-1-9-2-p0-and-new-devkits-released/)

    identify –version
    Version: ImageMagick 6.6.4-4 2010-09-17 Q16 http://www.imagemagick.org
    Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
    Features: OpenMP

    (It is the 32bit version of ImageMagick, the 64bit did not work).

  • http://www.waydotnet.com WaYdotNET

    Good news !
    Many thanks Joachim for information!

  • Kira Corina

    Remember that ImageMagick installation path should be without any spaces (“Program Files” are NOT OK). This was my issue, and was hard to work out.

  • http://www.waydotnet.com WaYdotNET

    @kira thanks !

  • Kira Corina

    @WaYdotNET: thanks to you, too! Your article is just a rescue for those who need Rmagick on Windows!
    I also made use of instructions in Joachim’s comment (ran “devkitvars.bat”, as there are no “msys” and “gcc” directories in the new devkit; and did not use msys.bat, simply ran “ruby setup.rb”). I did replace the “type-ghostscript.xml” file to make rmagick tests pass (otherwise they failed).
    This works for me on Windows XP, Ruby 1.92 and ImageMagick 6.6.5-4-Q16.

  • suresh

    I am not able to install devkit. could you please explain in detail for windows 7

  • http://www.waydotnet.com WaYdotNET
  • Jason Thomas

    Works with Ruby 1.9.2p136 RMagic 6.6.7-Q16 (16 bit images).

    Initially I was confused about downloading source vs the Windows binary but then found the right link. The official Windows binaries are here: http://www.imagemagick.org/script/binary-releases.php#windows And the archive is here: http://image_magick.veidrodis.com/image_magick/binaries/

  • http://www.waydotnet.com WaYdotNET

    Many Thanks Jason for update

  • http://www.facebook.com/riza.hisamuddin Riza Hisamuddin

    Hi
    I tried with with Ruby 1.9.2p180 and ImageMagick-6.6.7-9-Q16-windows-dll.exe on my Windows Vista.
    I did all instructions you mention above but I still cannot install RMagick on my laptop.

    I got messages like these:
    ERROR: Failed to build gem native extension.
    C:/Ruby192/bin/ruby.exe extconf.rb
    checking for Ruby version >=1.8.5…yes
    Invalid drive spesification.
    Unable to get ImageMagick version
    *** extconf.rb failed ***



    etc

    Could you give me a clue to solve this problem?

  • http://www.waydotnet.com WaYdotNET

    @riza:
    pls test with Works with RMagic 6.6.7-Q16 (16 bit images). (see http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/#comment-144895279) i’ve not vista only xp

  • http://www.facebook.com/riza.hisamuddin Riza Hisamuddin

    Hi again
    Right now I got different error message
    ” cheking for stdint.h… *** extconf.rb failed *** ”

    Do you have any suggestion about this issue?

    I tried to follow this http://phosphor-escence.blogspot.com/2010/12/if-you-fail-install-rmagick-on-mingw.html but still no goal

  • http://www.waydotnet.com WaYdotNET

    @Riza:
    Hi :D ,
    i’ve update post with very very simple instruction, but i’ve not Vista (only xp and Seven [trial])
    I hope this update resolve your problem

  • http://www.facebook.com/riza.hisamuddin Riza Hisamuddin

    Many thanks for the update :)
    Right now I got RMagick Installed on my Vsta
    Although, I failed at Step 5 no 3 and then I tried use this code and work perfectly
    gem install rmagick –platform=ruby — –with-opt-lib=C:ImageMagick-6.6.7-Q16lib –with-opt-include=C:ImageMagick-6.6.7-Q16include

    Thanks :)

    I translate your tutorial into my Language, which is Bahasa and put it on my web at http://www.megenep.com/riza-hisamuddin/blog/507

  • http://www.waydotnet.com WaYdotNET

    Good New Riza !!!!!

  • M Mosaad

    hi at step 5-3 i get an error i checked the mkmf.log file this is wat it says

    checking for Ruby version >= 1.8.5… ——————– yes

    ——————–

    “gcc -o conftest -Ic:/Ruby192/include/ruby-1.9.1/i386-mingw32 -Ic:/Ruby192/include/ruby-1.9.1/ruby/backward -Ic:/Ruby192/include/ruby-1.9.1 -Ic:/rmagick-rmagick-06ca7c7/ext/RMagick -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long conftest.c -L. -Lc:/Ruby192/lib -L. -lCORE_RL_magick_ -lX11 -lmsvcrt-ruby191-static -lshell32 -lws2_32 ”
    c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/ld.exe: cannot find -lCORE_RL_magick_
    c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/ld.exe: cannot find -lX11
    collect2: ld returned 1 exit status
    checked program was:
    /* begin */
    1: #include “ruby.h”
    2:
    3: #include
    4: #include
    5: int main() {return 0;}
    /* end */

    am not sure wat that means
    what am missing ?
    Thanks

  • http://www.waydotnet.com WaYdotNET

    Hi Mosaad, i don’t know…. os ?

  • M Mosaad

    windows 7

  • http://www.waydotnet.com WaYdotNET

    tomorrow re-test into vm , i’ve not laptop with me sorry

  • M Mosaad

    hey it worked thanks to Riza Hisamuddin in the comments :)

  • http://www.waydotnet.com WaYdotNET

    good Mosaad !!!

  • M Mosaad

    hey could you add this bit to ur guide
    http://phosphor-escence.blogspot.com/2010/12/if-you-fail-install-rmagick-on-mingw.html
    and also after it i had to this line to my gem file
    gem ‘rmagick’
    and thanks for the guide :D

  • Christian

    Thanks a lot – this was so painfull for me. Just to let you know what i was about to do and probably lead some search queries to this post:

    * Installed RadRails 2
    * Installed redmine following these instructions (http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI_on_Windows_with_Apache)
    * Set installed ruby as default interpreter
    * Started RadRails from within the “Start comman prompt with ruby”
    * RMagick was not found :( (
    * After some confusion and pain got rmagick built (Had error message ‘too many examples failed…’ but then ignored it and installed the created gem anyway
    * Finally it seems to work: I can start ruby with redmine and easy_agile-Plugin from within RadRails

    Thank you a lot :)

  • http://akira-onawa.com/2011/05/25/ruby1-9%e3%81%a7%e3%81%97%e3%81%8b%e3%82%8264bit-windows7%e3%81%a7%e3%80%81%e3%81%a4%e3%81%84%e3%81%abrmagick%e3%81%8c%e5%8b%95%e3%81%8d%e3%81%be%e3%81%97%e3%81%9f/ ruby1.9でしかも64bit windows7で、ついにrmagickが動きました | 大縄亮のブログ
  • pootyko

    man, thanks for the effort, but this is confusing.. all this edits? why not just remove what is not needed any more? multiple path resetting? :(

  • http://www.waydotnet.com WaYdotNET

    ok clean :d sorry

  • Vinícius Pereira

    Doesn’t works here.
    Ruby 1.9.2p290

    Windows 7 64-bit. Tried the ImageMagick version of the post and of this comment…

    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:/Ruby192/bin/ruby.exe extconf.rbchecking for Ruby version >= 1.8.5… yeschecking for stdint.h… *** extconf.rb failed ***Could not create Makefile due to some reason, probably lack ofnecessary libraries and/or headers.  Check the mkmf.log file for moredetails.  You may need configuration options.

    Any help???

  • http://www.waydotnet.com WaYdotNET

    You’ve tried with last imagemagick version ? (32bit, 64bit not work… but i’ve not Win64) and last Rmagick version ??

    Please post all your step 

  • Anon

    Hello,

    If you experience problems concerning “extconf.rb”, you should try 

    http://phosphor-escence.blogspot.com/2010/12/if-you-fail-install-rmagick-on-mingw.html

    before you go on to STEP 5 (please add this to the post!)

    Greetings from Germany

  • http://www.waydotnet.com WaYdotNET

    read the post, is present into post (after step 6)…

  • Dinamic D

    Thank you dude! It’s really works. 

  • http://www.waydotnet.com WaYdotNET

    Good !

  • http://programmersgoodies.com/paperclip-windows7-rails-3-1-%e2%80%9cidentify%e2%80%9d-issue%e2%80%a6-no-posted-solutions-working-how-do-i-fix-this-or-get-more-information Paperclip / Windows7 / Rails 3.1 “Identify” issue… no posted solutions working. How do i fix this or get more information? – Programmers Goodies

    [...] This one got close and has some good info, but didn’t actually fix it for me. http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/ [...]

  • Felix P.

    Hi,

    many thank for the great blog!

    It worked for me on Win 7×64 as well.
    Perhaps you could add as a final note, that one has to patch the Windows registry, if one wants to move the ImageMagicks folder to a different location.
    Regards, Felix Petriconi

  • Catherinewrf

    c:/Ruby192/bin/ruby.exe c:/RMagick-2.13.1/ext/RMagick/extconf.rbchecking for Ruby version >= 1.8.5… yeschecking for stdint.h… *** c:/RMagick-2.13.1/ext/RMagick/extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack ofnecessary libraries and/or headers.  Check the mkmf.log file for moredetails.  You may need configuration options.

    how can i do? my system is Windows xp sp3  32bit

  • http://www.waydotnet.com WaYdotNET

    in my laptop, with xp sp3 32bit work … set enviroment variables??? (step3)

  • Catherinewrf

    yes, I have set

  • http://www.waydotnet.com WaYdotNET

    repeat all step and read after step 6… with this few notice, i’ve not help you, sorry….

  • Catherinewrf

    I will try again. Thank you very much!

  • http://www.waydotnet.com WaYdotNET

    nothing… but it’s work ???

blog comments powered by Disqus