Thursday, September 11, 2008

How to install ImageMagick and RMagick on CEntOS

How to install ImageMagick and RMagick on CEntOS

Yum, yum, yummi

Install dependencies first.

yum install tcl-devel -y
yum install libpng-devel -y
yum install libjpeg-devel -y
yum install ghostscript-devel -y
yum install bzip2-devel -y
yum install freetype-devel -y
yum install libtiff-devel -y

Download and Install ImageMagick

As root, do the following:

cd /usr/local/src
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar xvfz ImageMagick.tar.gz
cd ImageMagick*
./configure
make
make install

This downloads and installs the latest stable ImageMaick package, but you can go to http://www.imagemagick.org/www/download.html and download the specific version you (might) need.

Add /usr/local/lib to ld.so.conf and reload

[ `grep /usr/local/lib /etc/ld.so.conf | wc -l` -eq 0 ] && echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig

Install RMagick ...

Finally install the ruby RMagick gem

gem install rmagick -r --no-ri --no-rdoc

I use to omit RDoc and ri documentation install, it takes longer, and the gem command is by itself SLOW. Remove the --no-rdoc --no-ri if you want to install'em.

That's all

Any doubts, leave a comment, I'll try to answer it as soon as possible.

Regards

Gabriel Medina