HowTo install rmagick gem on Windows » History » Version 10

Jonathan Hyry, 2017-12-20 23:00
Updated outdated information from rmagick github wiki, and replaced the dead link for archived binaries with a working link.

1 1 Etienne Massip
h1. HowTo install @rmagick@ gem on Windows
2 1 Etienne Massip
3 1 Etienne Massip
{{>toc}}
4 1 Etienne Massip
5 1 Etienne Massip
h2. Prerequisite
6 1 Etienne Massip
7 1 Etienne Massip
You need to have the "DevKit":http://rubyinstaller.org/add-ons/devkit installed.
8 1 Etienne Massip
9 1 Etienne Massip
h2. Installation of "ImageMagick":http://www.imagemagick.org
10 1 Etienne Massip
11 10 Jonathan Hyry
You can try to download last setup package from http://www.imagemagick.org/script/binary-releases.php#windows, but according to "RMagick wiki":https://github.com/rmagick/rmagick/wiki/Installing-on-Windows, the last known version to work is 6.9.1. ImageMagick legacy binary versions are available at https://sourceforge.net/projects/imagemagick/files/im6-exes/.
12 1 Etienne Massip
13 8 Dmitry Popov
Run the setup package. In the ??Select Additional Tasks?? page of the wizard, make sure that both _Add application directory to your system path_ and _Install development headers and libraries for C and C++_ options are checked:
14 1 Etienne Massip
15 7 Dmitry Popov
!imagemagick-setup.gif!
16 1 Etienne Massip
17 8 Dmitry Popov
*Note:* Both the ImageMagick application directory and the Windows\System32 directory contain an executable named _convert.exe_. Unless ImageMagick's directory is added the front of the system path, its copy will not be found. This will cause the test suggested at the completion of the installation to fail with a message _Invalid Drive Specification_. Also note that Window's copy of _convert.exe_ will not be found if ImageMagick is placed first in the path.
18 1 Etienne Massip
19 3 John Pankowicz
h2. Installation of the @rmagick@ gem
20 3 John Pankowicz
21 8 Dmitry Popov
Open a new command prompt.
22 1 Etienne Massip
23 8 Dmitry Popov
Change current directory to the Redmine installation directory
24 8 Dmitry Popov
25 8 Dmitry Popov
Set @CPATH@ and @LIBRARY_PATH@ environment variables to point respectively to @ImageMagick@ installation directory @include@ and @lib@ subdirectories (so the DevKit will find them at build time)
26 8 Dmitry Popov
27 4 Dmitry Popov
<pre>
28 4 Dmitry Popov
set CPATH=C:\Program Files (x86)\ImageMagick-6.7.9-Q16\include
29 4 Dmitry Popov
set LIBRARY_PATH=C:\Program Files (x86)\ImageMagick-6.7.9-Q16\lib
30 4 Dmitry Popov
</pre>
31 1 Etienne Massip
32 8 Dmitry Popov
Install the gem by running @bundle install@.
33 1 Etienne Massip
34 6 Dmitry Popov
!rmagick-install-cmd.gif!
35 1 Etienne Massip
36 9 Dmitry Popov
*Note:* bundler remembers the list of groups to skip set with @--without@ option. If you have already run @bundler install --without rmagick@, you'll need to modify @redmine\.bundle\config@ file.
37 9 Dmitry Popov
38 9 Dmitry Popov
<pre>
39 9 Dmitry Popov
---
40 9 Dmitry Popov
BUNDLE_WITHOUT: development:test
41 9 Dmitry Popov
</pre>
42 9 Dmitry Popov
43 4 Dmitry Popov
h2. Result
44 4 Dmitry Popov
45 4 Dmitry Popov
Check if the installation was successful on the Information page.
46 4 Dmitry Popov
47 6 Dmitry Popov
!rmagick-information.gif!