Home > feisty fawn, gem, linux, rails, ror, ruby, rubyonrails, ubuntu > How to install RMagick Gem on Linux/Ubuntu

How to install RMagick Gem on Linux/Ubuntu

While installing RMagick on Linux, if you are getting errors like this
“GraphicsMagick-config… no configure: error: Can’t install RMagick. Can’t find Magick-config or GraphicsMagick-config program. …”,
below is the solution for this error.

RMagick requires ImageMagick and which further requires loads of dependencies already available to get installed and work properly. I was figuring out of those all, and thank god got a quite simple and elegant way to do all that in just three commands.
First you will have to install imagemagick then libmagick9-dev and then finally you can install rmagick.

Here are the commands…

[source:ruby]
sudo apt-get install imagemagick
sudo apt-get install libmagick9-dev
sudo gem install rmagick
[/source]

sur feisty fawn, gem, linux, rails, ror, ruby, rubyonrails, ubuntu

  1. July 24th, 2007 at 17:57 | #1

    This rocks - thanks for saving me from 2 days of apt-get hell.

  2. August 14th, 2007 at 00:04 | #2

    Awesome!

  3. sms
    September 12th, 2007 at 08:09 | #3

    Only works on Ubuntu .. Tried on PCLinuxOS and it’s bad .. really bad.
    The Development Libraries conflict with the regular ones ..

    I wish you had used gd2 instead of RMagic stuff .. not really worth the trouble .. 4+ hours and no end in sight

  4. September 12th, 2007 at 09:16 | #4

    So, can’t you read the title that its for Ubuntu… If suits you then use it… otherwise stop cribbing, find a way out for whatsoever OS you are upto and post it on your blog to help others.

  5. sms
    September 14th, 2007 at 06:46 | #5

    I did read, you seem to have the blinders .. take it for what it’s worth.
    Yes, here you say that this is howto for Ubuntu .. but I followed this link from your simple-captcha .. it wasn’t mentioned anywhere that it will only work out of the box on Ubuntu .. I did arrive at this point after 2+ hours of your 10 minutes solution.

    So some cribbing is warranted.

    The problem is for KDE based systems, a lot them packages rely on ImageMagick with the “non-dev” version of the lib installed.
    There is NO easy solution to it .. if you try to install the -dev version of the lib, then it removes all the packages using the regular lib and then you have 10 times more work at hand. (this with synaptic of course .. you can do a hand job and possibly get away .. but you never know what that will break.)

  6. sms
    September 14th, 2007 at 06:47 | #6

    And BTW you don’t have to do cli based installed, both of these ImageMagick and the lib are available as Ubuntu packages from Synaptic it self .

  7. December 22nd, 2007 at 21:44 | #7

    Hey Thanks SUR,

    I upgraded my ubuntu from 7.04 to 7.10, and was trying to install RMagicK. It was throwing the error you said above, even all the required libs are installed. I followed the steps you specified and all done.

    You saved much time

    Thanks again

  8. December 23rd, 2007 at 02:16 | #8

    Hey Akhil,

    glad to know that it helped you :)

  9. todd
    August 7th, 2008 at 14:36 | #9

    Haven’t introduced a security flaw into your system when you follow these instructions? http://www.ruby-lang.org/en/news/2008/06/20/arbitrary-code-execution-vulnerabilities/ Ubuntu using a vulnerable version of ruby but perhaps ubuntu security cancels this out. I don’t know.

  10. rek
    March 30th, 2009 at 23:07 | #10

    thank you very much

  11. Josh
    April 24th, 2009 at 09:23 | #11

    Can’t thank you enough for this, saved me from a huge headache. Kudos!

  1. July 10th, 2007 at 01:37 | #1
  2. July 24th, 2007 at 07:28 | #2
  3. June 3rd, 2008 at 22:47 | #3
  4. January 16th, 2009 at 22:25 | #4