Skip to content
This repository

Welcome to the rmagick wiki!

Installing on Windows

  1. Install ImageMagick binary version: http://www.imagemagick.org/script/binary-releases.php#windows . The last known version to work is 6.7.9.9. Find archived versions of ImageMagick here http://www.imagemagick.org/download/windows/legacy/ . If you try a newer version such as 6.8, you will get compile errors such as http://pastebin.com/j4vM5kLa . If you don't want to compile it from source, you can find legacy binary versions at http://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/binaries/.

  2. ImageMagick must be installed with the development headers option (install lib and include directories) Header files

  3. Set ImageMagick to be first in your system path:

    path=c:\RailsInstaller\ImageMagick-6.7.9-Q8;%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.

  4. Ensure you have a compiler on your command line, such as MingW in DevKit (which comes packaged with RailsInstaller.org).

  5. Install the rmagick gem. 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:

    5.1. There's a double-dash separating "rmagick" and the --with-opt-dir option

    5.2. The --with-opt-dir option is surrounded by single-quotes

    5.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. I think the path also doesn't care about forward or backward slashes, but I use backslashes.

  6. Edit C:\RailsInstaller\Ruby1.9.3\setup_environment.bat to include the path to ImageMagic, line 25: SET PATH=c:\RailsInstaller\ImageMagick-6.7.9-Q8;...

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.1 to build together on both Windows 7 and Server 2003. Below is a transcript building ImageMagick 6.7.9 and rmagick 2.13.1 on Windows XP:

C:\Sites>gem install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6.7.9-Q8"'
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.1
1 gem installed
Installing ri documentation for rmagick-2.13.1...
Installing RDoc documentation for rmagick-2.13.1...

Installing on Cygwin (Windows)

  1. Run setup.exe.
  2. Select ImageMagick and libMagick-devel (for the header files).
  3. Run gem install rmagick

Example:

    $ gem install rmagick
    Fetching: rmagick-2.13.1.gem (100%)
    Building native extensions.  This could take a while...
    Successfully installed rmagick-2.13.1
    1 gem installed
Something went wrong with that request. Please try again.