Installing RMagick on OSX

Note: This post is over 2 years old. You may want to check later in this blog to see if there is new information.

First FloorOkay, I finally got RMagick installed on my G5. RMagick is a wrapper for ImageMagick that allows Ruby to handle image functions of all sorts. I wanted to use it to create and upload thumbnails to my blog from TextMate (I did it, that’s where the one in this post came from). I’m running OSX 10.4.8. I ran into a couple of sticky spots. So here’s what I have to share…

First things first, if you don’t have the XCode tools, you’re going to need them. It’s a HUGE download (just under a gig) but it’s required to compile all of the necessary packages. You’ll need to sign up for a developer account with Apple and then leave your mac running for a while ;-).

I tried several installation routes, but the most successful one was at Hivelogic, and involved compiling everything by hand. The instructions are good, so if you’re timid, you can just copy and paste. However, there are a couple of things to note.

First of all, when you get around to building RMagick, you may run into a ‘headers not found’ error. The headers are there, but for some reason they’re all in /usr/lib/ruby/1.8/universal-darwin8.0 and they need to be in /usr/lib/ruby/1.8/powerpc-darwin8.0. If you run into the error, copy all of the *.h files from universal-darwin8.0 to powerpc-darwin8.0 and it will fix it.

Second, the instructions leave out Ghostscript, which besides being necessary for text, it seemed to cause compile errors when it was missing. See the addendum at Two Scoops for instructions. Install Ghostscript before you compile ImageMagick.

Lastly, using gem to install RMagick resulted in TextMate not being able to find it. I’m sure there’s an environment variable I could set to fix that, but the easiest fix I could find was just to download RMagick from Rubyforge and do a ./configure; make; sudo make install.

That got it running for me. I would compile all of these instructions into one complete document but I’m not overly motivated to rewrite something that’s already been written. I’ll just point to all the places that need pointing to. If anyone wants to make a revised document that is a little more helpful than all of these are individually, it would probably be welcomed by people running into these problems. Oh hell, I’ll do it. Just give me a little time.

Anyway, I got RMagick running and with my modified blogging.rb file for the blogging bundle in TextMate, I can now create thumbnails on the fly when I drag and drop an image onto a post. You may remember me mentioning that I had that working on my laptop, but getting it working on my G5 was proof that I have it modularized relatively well. What I need now is a way to check for the RMagick library and only offer the thumbnails if it’s installed. Any suggestions? This won’t be ready for prime time until it has such error checking.

Man, I did a lot besides work today.

» » » » »

Comments are closed

Comments are currently closed on this entry.
  1. The Plaid Cow 11.15.06 / 12am

    Does the update to the blogging bundle also have the ability to create a popup window html for the image (like MovableType). That would be so cool. And save e a heck of a lot of work.

    Are you planning on distributing the bundle?

    Can you drop me a line if the answer to any of these is yes (since I can’t subscribe to comments)?