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]
11 Comments to "How to install RMagick Gem on Linux/Ubuntu"
Please share your thoughts
Filed in: feisty fawn, gem, linux, rails, ror, ruby, rubyonrails, ubuntu


[...] Trying to get RMagick Gem installed can be a pain the butt on any system including Ubuntu Feisty. Thankfully Sur figured out how to do it 3 easy steps. [...]
[...] Well, the 2nd one…. Found here. [...]
This rocks - thanks for saving me from 2 days of apt-get hell.
Awesome!
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
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.
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.)
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 .
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
Hey Akhil,
glad to know that it helped you
[...] Provides Ruby 1.8.6 (patchlevel 111). Good! The libmagick is also available but still the RMagick needs to be installed the way I posted here. [...]