mini_magic and Apache Passenger

JP’s a Dad now 😳 January 23, 2013
Source

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:

Discussion in the ATmosphere

Loading comments...