How to Install Rmagick Gem on Windows

How to install rmagick gem on Windows?

RMagic won't work with ImageMagic 6.8. I updated the RMagick Github wiki with detailed instructions.

https://github.com/rmagick/rmagick/wiki

There I found gems (haha) such as

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.

and

gem install rmagick -- '--with-opt-dir="[path to ImageMagick]"'

(Obvious, huh?)

I believe RMagick is a dead project. There hasn't been a commit for 2 years!

installing rmagick gem on windows

I had this problem a few days ago and I solved it by following a bunch of tutorials.

In short, your error seems to be due to a compatibility problem between your ImageMagic and Rmagick.

Uninstall ImageMagick and re-install a previous version that works with your Ruby setup.

This is what worked for me :

  • Ruby 1.9.3
  • Dev Kit 32-4.5.2
  • ImageMagick 6.7.7 (I had a really hard time finding binary versions for legacy versions of ImageMagick so i guess this link will be handy for you)
  • Rmagick 2.13.2

Install ImageMagick and rmagick on Windows 7

I have installed it. You will need to install Ruby Devkit.

https://rubyinstaller.org/downloads/

It was very tedious process so I made notes for a client. Steps are mislabelled because it includes installing git and ruby first. I would use more recent instructions on websites if available.

I think that ImageMagick needed to be version 6, not sure.

Here are the notes:

3. Install devkit

Same link http://rubyinstaller.org/

Download and extract to C:\RubyDevkit

Follow steps 3.1 and 3.2 if you downloaded DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe

For other versions, if you are getting error messages then use instructions from http://rubyinstaller.org/

which used to link to this document:
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

3.1. Entire DevKit procedure at a glance

  • Download matching version (from http://rubyinstaller.org/)
  • Uninstall previous version if it exists.
  • Extract to C:\RubyDevKit

You need to open CMD.exe (do not use git bash) to C:\RubyDevKit and type these commands.

cd C:\RubyDevKit
ruby dk.rb init
ruby dk.rb install
devkitvars.bat

4. Install imagemagick

If your ruby is 32 bit, install 32 bit otherwise 64 bit.

What works for sure is ImageMagick-6.7.3-4-Q16-windows-dll.exe

Don't install in Program Files because 3rd party scripts might have problems with spaces.

Install in C:\ImageMagick so that you can copy paste commands later

Make sure these options are checked

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

5. Install rmagick gem

Just running bundle install fails because it requires more options.

Run this from anywhere in cmd.exe
To open cmd.exe open Start Menu and under Search programs and files type cmd.exe

set CPATH="C:\ImageMagick\include"
set LIBRARY_PATH="C:\ImageMagick\lib"

Unfortunately these commands give no visual feedback like OK. To get feedback you can type this:

echo %CPATH%

And you should get output "C:\ImageMagick\include"

echo %LIBRARY_PATH%

And you should get output "C:\ImageMagick\lib"

gem install rmagick -- '--with-opt-dir="C:\ImageMagick"'

You should get a success message. You can verify if gem is installed by typing

gem list

It should list rmagick.

Try this first, but in case this doesn't work, look up more current instructions on:

https://github.com/rmagick/rmagick/wiki/Installing-on-Windows



Related Topics



Leave a reply



Submit