So far, it\’s RoR

Ruby on Rails, PostgreSQL, SVN, etc….

Linux commands to install ImageMagick and RMagick

Posted by Chirag Patel on December 19, 2007

This is what I had to do to get it to work on CentOS 5. For some reason, FreeType would not work with yum so I built it from scratch. I’m not sure if the all the “yum install”s were needed, but I did it anyway.

#yum install freetype — did not work

cd /usr/local/src


tar xvzf freetype-2.3.5.tar.gz



make install


yum install glib
yum install glib2
yum install libpng
yum install libjpeg
yum install libtiff
yum install ghostscript
yum install freetype


cd /usr/local/src


tar xvzf ImageMagick.tar.gz

cd ImageMagick-X.Y.Z

./configure –disable-static –with-modules –without-perl –without-magick-plus-plus –with-quantum-depth=8 CFLAGS=-fPIC


make install



tar zxvf RMagick-1.15.11.tar.gz

cd RMagick-1.15.4


export LD_LIBRARY_PATH=/usr/local/lib



make install



#test Rmagick in Rails

root# ruby script/console

irb(main):001:0> require ‘RMagick’

irb(main):002:0> include Magick

=> Object

irb(main):003:0> img = “test.jpg”

=> [test.jpg JPEG 10×11 DirectClass 8-bit 391b]

irb(main):004:0> img.write “test.png”

=> [test.jpg=>test.png JPEG 10×11 DirectClass 8-bit]




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: