Can’t install RMagick 2.13.1. Can’t find Magick-config

Problem

You are trying to install rmagick in an Ubuntu 12.04 virtual box, but you get the following error:

Can't install RMagick 2.13.1. Can't find Magick-config

Solution

Make sure you install both the imagemagick and the libmagickwand-dev packages with either apt-get :

sudo apt-get install imagemagick libmagickwand-dev

or in a puppet script as:

package {
  "imagemagick":
    ensure => installed
}

package {
  "libmagickwand-dev":
    ensure  => installed
}

ImageMagick, RMagick, Debian installation

Problem
You want to use the rmagick gem in your ruby on rails project, but you need to install the imagemagick first.

Solution
If Imagemagick is not already installed, use the following to install it:
$ sudo apt-get install imagemagick$ sudo apt get install libmagick-dev libmagickwand-dev

You should then be able to install and use the rmagick gem

ImageMagick, RMagick, Mandriva 64 installation

Problem
You want to use the rmagick gem in your ruby on rails project, but you need to install the imagemagick first.

Solution
If Imagemagick is not already installed, use the following to install it:
$ sudo urpmi imagemagick$ sudo urpmi lib64magick-devel

You should then be able to install and use the rmagick gem

Help! I’m getting the message “libMagickWand.so.1: cannot open shared object file: No such file or directory” I know ImageMagick is installed! What should I do?

Problem
Cannot install RMagick as there is an error about nob being able to find some shared libraries.

Solution
After reading the RMagick installation FAQ it seem there is a problem with the LD_LIBRARY_PATH that cannot find the needed libraries as they are installed in /usr/local/lib instead of /usr/lib.
Doing a quick search revealed that people suggest that the LD_LIBRARY_PATH shouldn’t be changed, for various reasons.
So, the quick solution is to create a couple of symbolic links for the libraries that cannot be found, ie:

sudo ln -s /usr/local/lib/libMagickWand.so.4 /usr/lib/libMagickWand.so.4
ln -s /usr/local/lib/libMagickCore.so.4 /usr/lib/libMagickCore.so.4

undefined method ‘remap’ for class ‘Magick::Image’

Problem
You have just deployed your rails application to dreamhost but you are getting this error from passenger.

Solution
There was a change in the ImageMagic between versions 6.4.3 and 6.4.4 from the affinity function to remap.
If you don’t want, or don’t have time to recompile the ImageMagick and install the rmagick gem, you can comment out the two declarations for the alias functions, located around lines 782 and 1525 in the file rmagick-2.12.2/lib/RMagick.rb:

alias_method :affinity, :remap