Howto: Install RMagick on Windows 64 bits

I ran into a lot of problems trying to install RMagick on my 64bits Windows, but finally succeeded.

Here is how:

  1. Install ImageMagick: version 6.6.9-5 32 bits. The version is important: I tried with 64bits versions, and also with 6.6.9-9 and 6.7.* versions and it failed miserably. You can find it here. Don’t forget to include development headers for C and C++ and also modify the PATH environment variable during the installation process.
  2. Install the Ruby Development Kit. You can find it here.
  3. Modify a little header in the DevKit. Search for the file /mingw/include/sys/types.h, and replace int with long at line 115:
    #ifndef _SIGSET_T_
    #define	_SIGSET_T_
    typedef int	_sigset_t;
    #ifndef	_NO_OLDNAMES
    typedef _sigset_t	sigset_t;
    #endif	/* Not _SIGSET_T_ */
    #ifndef _SSIZE_T_
    #define _SSIZE_T_
    typedef long _ssize_t;
    #ifndef	_NO_OLDNAMES
    typedef _ssize_t ssize_t;
    #endif /* Not _SSIZE_T_ */ 
  4. In a terminal, modify your environment this way:
    set DFImageMagick=<ImageMagickInstallationPath>
    set CPATH=%DFImageMagick%\include;%CPATH%
    set LIBRARY_PATH=%DFImageMagick%\lib;%LIBRARY_PATH%
  5. Install RMagick gem:
    gem install rmagick

This worked for me, I hope it will help others.

About Muriel Salvan

I am a freelance project manager and polyglot developer, expert in Ruby and Rails. I created X-Aeon Solutions and rivierarb Ruby meetups. I also give trainings and conferences on technical topics. My core development principles: Plugins-oriented architectures, simple components, Open Source power, clever automation, constant technology watch, quality and optimized code. My experience includes big and small companies. I embrace agile methodologies and test driven development, without giving up on planning and risks containment methods as well. I love Open Source and became a big advocate.
Howto, Ruby, Windows , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *