How to set up nanoc with ImageMagick / RMagick on Windows

I recently created a nanoc site for a photographer. The site needed to generate image galleries and run on Windows, hence the requirements for ImageMagick via RMagick on Windows 7.


Install xampp or your webserver or choice.

xampp was used to preview the site before uploading to the hosting. I won’t go into the setup instructions here - suffice to say that the virtual host configuration will need to have its DocumentRoot pointing to the ‘output’ folder of your nanoc site.

Ruby and rubygems

Install Ruby and gem using RubyInstaller

Ruby development kit

Install Ruby Development Kit

This is required so that RMagick can build its native extension in order to interact with ImageMagick.

Download the dev kit from RubyInstaller Downloads. We want the MSYS one (not the MinGW one), which at the time of writing was DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe.

Execute this file and it’ll extract a folder, which I’ll call [devit] for this guide. Then, in the command prompt:

cd [devkit]
ruby dk.rb init
ruby dk.rb install

Remember to replace [devkit] with the location of the extracted dev kit folder.

RMagick (with ImageMagick)

Install ImageMagick and RMagick

The Redmine Wiki has a good guide here: HowTo install rmagick gem on Windows.


Download the Windows Binary Release.

Install ImageMagick with the following options, taking note of where it installs (which we’ll call [ImageMagick]):

  • Add application directory to your system path.
  • Install development headers and libraries for C and C++.


In the command prompt:

set CPATH=C:\Program Files\ImageMagick-6.7.7-Q16\include
set LIBRARY_PATH=C:\Program Files\ImageMagick-6.7.7-Q16\lib

Where C:\Program Files\ImageMagick-6.7.7-Q16 should be replaced with the name of the ImageMagick installation path.

Then install the gem:

gem install rmagick


Install nanoc as a gem with the following command:

gem install nanoc

More details on the nanoc install page

Last modified: 28/02/2013 Tags: , , ,

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top