{
"path": "/posts/tumblr-musings/mini-magic-apache-passenger",
"site": "at://did:plc:ephkzpinhaqcabtkugtbzrwu/site.standard.publication/3mdogbputbg2m",
"tags": [
"ruby",
"apache",
"passenger",
"code",
"fix",
"imagemagick",
"homebrew",
"from-tumblr"
],
"$type": "site.standard.document",
"title": "mini_magic and Apache Passenger",
"publishedAt": "2013-01-23T11:26:00.000Z",
"textContent": "A note out there to anyone else having the same problem as me:\n\nIf 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.\n\nThis 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.\n\nIt seems that the _www user doesn't check the /etc/paths file for additions to the PATH variable, so you get squat.\n\nMy 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.\n\nIt now looks something like this:",
"canonicalUrl": "https://www.byjp.me/posts/tumblr-musings/mini-magic-apache-passenger"
}