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

wget http://download.savannah.gnu.org/releases/freetype/freetype-2.3.5.tar.gz

tar xvzf freetype-2.3.5.tar.gz

./configure

make

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

wget http://image_magick.veidrodis.com/image_magick/ImageMagick.tar.gz

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

make install

 

wget http://files.rubyforge.mmmultiworks.com/rmagick/RMagick-1.15.11.tar.gz

tar zxvf RMagick-1.15.11.tar.gz

cd RMagick-1.15.4

./configure

export LD_LIBRARY_PATH=/usr/local/lib

echo $LD_LIBRARY_PATH

make

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 = ImageList.new “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]

irb(main):005:0>

 

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

 
%d bloggers like this: