Friday 3 May 2013

RMagick gem and UBUNTU 13.04


I recently upgraded my OS from Ubuntu 12.04 ro 13.04, Since then my 'rmagick' gem was not working. I used to get below error while starting my rails server ;

libMagickCore.so.4: cannot open shared object file: No such file or directory - /home/shilesh/.rvm/gems/ruby-1.8.7-p352@rails_2.3.16/gems/rmagick-2.12.2/lib/RMagick2.so (LoadError) 

Installing gem using bundler used to give below error;

$ gem install rmagickBuilding native extensions.  This could take a while...ERROR:  Error installing rmagick: ERROR: Failed to build gem native extension.
        /home/shilesh/.rvm/rubies/ruby-1.8.7-p352/bin/ruby extconf.rbchecking for Ruby version >= 1.8.5... yeschecking for gcc... yeschecking for Magick-config... yeschecking for ImageMagick version >= 6.4.9... yeschecking for HDRI disabled version of ImageMagick... yeschecking for stdint.h... yeschecking for sys/types.h... yeschecking for wand/MagickWand.h... no
Can't install RMagick 2.13.2. Can't find MagickWand.h.*** extconf.rb failed ***Could not create Makefile due to some reason, probably lack ofnecessary libraries and/or headers.  Check the mkmf.log file for moredetails.  You may need configuration options

Finally I re-installed ImageMagick and RMagick gem as given below, that worked,finally.

$ sudo apt-get install imagemagick

$sudo apt-get install libmagickwand-dev


$ gem install rmagick
Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.2
1 gem installed
Installing ri documentation for rmagick-2.13.2...
Installing RDoc documentation for rmagick-2.13.2..