Follow the below steps
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
Next configure and compile ImageMagick:
tar xvfz ImageMagick.tar.gz cd ImageMagick-6.6.3 ./configure make
If ImageMagick configured and compiled without complaint, you are ready to install it on your system. Administrator privileges are required to install. To install, type
sudo make install
Finally, verify the ImageMagick install worked properly, type
/usr/local/bin/convert logo: logo.gif
For a more comprehensive test, run the ImageMagick validation suite. Ghosts cript is a prerequisite, otherwise the EPS, PS, and PDF tests will fail.
make check
Reference : http://www.bunchedin.com/aOqNOv


You may also try the below if you have any problem
apt-get install imagemagick libmagick9-dev -y
if the above doesnt work then do
apt-get update
now retry …
After doing this ,
gem install rmagick
to test rmagick installation
irb -rubygems -r RMagick