A note out there to anyone else having the same problem as me:

If you're trying to use mini_magick in a ruby application being run via Passenger on Mac OS X Mountain Lion's Apache2, when you've installed imagemagick via Homebrew - mouthful - then you may notice that that you get a Server Error when you try to process an image.

This may be because the PATH variable Apache is supplying to your ruby instance doesn't have /usr/local/bin in it, which is where homebrew installs to.

It seems that the _www user doesn't check the /etc/paths file for additions to the PATH variable, so you get squat.

My solution is hacky, but it gets the job done. I have a file called /etc/apache2/other/passenger.conf which holds the details for the virtual hosts for my passenger apps. I added the SetEnv line at the top to force Apache to set the PATH variable correctly.

It now looks something like this:

SetEnv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
ServerName my.rubyapp.com
ServerAlias my.rubyapp.com
DocumentRoot /var/www/myapp/public
RackEnv production
Order allow,deny
Allow from all
ErrorLog "/var/log/apache2/my.rubyapp.com_error-log"
CustomLog "/var/log/apache2/my.rubyapp.com_access-log" common