Using RMagick

Things that can go wrong

Can’t install RMagick. Can’t find libMagick or one of the dependent libraries. Check the mkmf.log file for more detailed information.

Typically this message means that one or more of the libraries that ImageMagick
depends on hasn’t been installed. Examine the mkmf.log file in the ext/RMagick
subdirectory of the installation directory for any error messages. These messages
typically contain enough additional information for you to be able to diagnose
the problem. Also see this FAQ.

Cannot open shared object file

you probably do not have the directory in which the ImageMagick library
is installed in your load path. An easy way to fix this is to define
the directory in the LD_LIBRARY_PATH environment variable. For
example, suppose you installed the ImageMagick library libMagick.so in
/usr/local/lib. (By default this is where it is installed.) Create the
LD_LIBRARY_PATH variable like this:

export LD_LIBRARY_PATH=/usr/local/lib

On Linux, see ld(1) and ld.so(8) for more information. On other operating
systems, see the documentation for the dynamic loading facility.

Segmentation fault

Default stack size of your operating system might be too small. Try removing the limit with this command:

ulimit -s unlimited

Upgrading

If you upgrade to a newer release of ImageMagick, make sure you’re using a
release of RMagick that supports that release. It’s safe to install a new
release of RMagick over an earlier release.

More samples

You can find more sample RMagick programs in the /example directory.
These programs are not installed in the RMagick documentation tree.

Reporting bugs

Please report bugs in RMagick, its documentation, or its installation
programs to me via the bug tracker on the RMagick issues page

However, I can’t help with Ruby installation and configuration or ImageMagick
installation and configuration. Information about reporting problems and
getting help for ImageMagick is available at the ImageMagick web site
or the ImageMagick Forum.

Development Setup

In order to minimize issues on your local machine, we recommend that you make
use of a Vagrant installation.

Steps to get up and running with a passing build are as follows:

1) set up the Vagrant environment

If you don’t already have Vagrant installed, you can download and install it
from here. Once installed, we can set up a pre-built environment:

This last part will probably take a while as it has to download an Ubuntu image
and configure it. If there is an error during this process, you may need to
reboot your computer and enable virtualization in your BIOS settings.

And you’re all set! The copy of RMagick within `/vagrant/rmagick` inside your
Vagrant session is the same as the one in the `rake-compiler-dev-box` directory
on your machine. You can make changes locally and run tests within your `ssh`
session.