As part of a new rails site I’m working on, I found that I needed to install Rmagic to provide image manipulation in my app. So what I found was that it was going to as easy as installing the rmagick gem.
So I fired up my terminal and typed
sudo gem install rmagick
Whoops!!! Error time!
Bulk updating Gem source index for: http://gems.rubyforge.org
Building native extensions. This could take a while...
configure: error: Can't install RMagick. Can't find Magick-config or GraphicsMagick-config program.
ERROR: While executing gem … (RuntimeError)
ERROR: Failed to build gem native extension.
Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/rmagick-1.15.7 for inspection.
So off I went to find a solution to this problem and kill a couple of hours of free time.
I found an post by Paul Hepworth on installing Rmagick on OSX but I didn’t have macports installed so off I went again to find an alternative solution.
Rmagick at ruby-forge happened to have installation instructions but I had another problem. I also needed to have X11 installed which I didn’t so I had to digg up my OSX installation disk and follow some instructions on installing X11 on mac on this post by trae mccombs.
Back to the rmagick instructions on ruby-forge you’ll find a ruby script that you can run now that you have X11 installed and it’ll do the whole install for you. Then all that’s left to do is
sudo gem install rmagick
Code on!!!