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

RMagick on Ruby 1.9.1 (i386-mingw32) Work !!! 😀
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) 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) 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-Q16configtype-ghostscript.xml  with type-windows.xml
4) RMagick => c:rmagick-rmagick

Step 3: Set Enviroment variable

1) PATH = C:Ruby192bin;C:ImageMagick-6.6.7-Q16
2) CPATH = C:ImageMagick-6.6.7-Q16include
3) LIBRARY_PATH = C:ImageMagick-6.6.7-Q16lib

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

1) cd c:DevKit
2) ruby dk.rb init
3) ruby dk.rb install
4) C:DevKitdevkitvars.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) run C:DevKitmsys.bat
2) cd /c/rmagick-rmagick
3) ruby setup.rb
4) ruby setup.rb install

Step 6: Check

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!configtype-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!devkitmsys1.0.11bin
set PATH = !ruby_path!devkitgcc3.4.5bin
[EDIT]
7) run “ruby setup.rb” [EDIT] from msys.bat ( !ruby_path!devkitmsys1.0.11msys.bat ) [EDIT]

 

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

9) Enjoy 😀

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

  • 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’)

    • 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

  • 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!

  • @Alex : 😀 Well!

  • Pingback: Tweets that mention puts WaYdotNET => Carlo Bertini » RMagick on Ruby 1.9.1 (i386-mingw32) Work !!! :D [UPDATE] -- Topsy.com()

  • Pingback: installing rmagick with mingw and ruby 1.9 « Roger's woze()

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

  • 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 )

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

  • Ruby 1.9.2p0 WORK !

  • worrawut

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

  • 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)

  • How can I perform this step?

    5) Replace !ImageMagick Path!configtype-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.

  • @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?

  • Abder sorry for later… 😀
    thx 4 found error link 😀

    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 filesImageMagickconfigtype-windows.xml replace with http://www.imagemagick.org/source/type-windows.xml )

    my english now is very very bad 😀

  • 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:optImageMagick-6.6.4-Q16include
    set LIBRARY_PATH=c:optImageMagick-6.6.4-Q16lib
    path %PATH%;c:optImageMagick-6.6.4-Q16
    C:optdevkitdevkitvars.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).

    • 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???

      • 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 

  • 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.

    • @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.

  • 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.

    • @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.

  • 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/

  • 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/

  • 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?

  • 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?

  • 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 🙂

  • 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 🙂

  • Pingback: 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? 🙁

  • 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? 🙁

  • 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???

    • 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

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

  • 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

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

  • Dinamic D

    Thank you dude! It’s really works. 

  • Dinamic D

    Thank you dude! It’s really works. 

  • Pingback: Paperclip / Windows7 / Rails 3.1 “Identify” issue… no posted solutions working. How do i fix this or get more information? - Programmers Goodies()

  • 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