Reputation: 1074
I am trying to use the Paperclip gem on a Rails project so followed the docs and first installed Imagemagick using the Homebrew recipe.
I added to my model my attachment
has_attached_file :screenshot
This worked OK and the file uploads functioned as expected
I then wanted to add thumbnails to this, so again followed the docs and added to the model
has_attached_file :screenshot,
:styles => { :medium => "300x300>",
:thumb => "100x100>" }
At this point the uploads no longer worked
I check the development logs and noticed this:
[32mCommand[0m :: identify -format %wx%h '/var/folders/ky/r5gsdhbn6yggbglsg727cc900000gn/T/stream20120302-60051-eh17n7.png[0]'
[paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError:
/var/folders/ky/r5gsdhbn6yggbglsg727cc900000gn/T/stream20120302-60051-eh17n7.png is not recognized by the 'identify' command.>
At which point after some googling I thought it might be a problem with setting the default path as an environment variable
Paperclip.options[:command_path] = "/usr/local/bin/"
But I checked that this was correct using
which identify
And it returned this path
/usr/local/bin/identify
As expected
I then tried to run identify from the command line as a test and got this error
dyld: Library not loaded: /usr/X11/lib/libfreetype.6.dylib
Referenced from: /usr/local/bin/identify
Reason: Incompatible library version: identify requires version 14.0.0 or later, but libfreetype.6.dylib provides version 13.0.0
Trace/BPT trap: 5
So I think my problem is not with paperclip, but rather the install of imageMagick via homebrew
I've tried everything suggested including
brew update
brew remove imagemagick
brew install imagemagick
But it hasn't helped i'm running Lion 10.7.2 and have installed the developer tools.
Any suggestions would be very much appreciated.
Upvotes: 7
Views: 6327
Reputation: 449
There's a simpler solution. Either install freetype:
brew install freetype
or, if it's already installed, then you need to recreate the links:
brew unlink freetype && brew link freetype
this will fix everything for you. Well, not everything, but it'll at least fix this problem.
Upvotes: 10
Reputation: 1693
I hope this helps to someone: After I try all these solution out there (update brew, reinstall imagemagick, unlink and link again) without success, came to my mind that Paperclip might be the issue. I just do:
bundle update paperclip
And problem solved!
Note: imagemagick is working properly to me. When I run identify -format %wx%h /path/to/a/file
from console, it works fine (I get the image's size). The 'identify' problem was happening only from my rails app.
Upvotes: 0
Reputation: 2369
After a software update on OSX MoutainLion ImageMagick stopped working for me too, but simply following the steps taken by Chris worked:
brew update
brew remove imagemagick
brew install imagemagick
Upvotes: 2
Reputation: 769
libfreetype was missing on my Mountain Lion (10.8) installation. In this case, installing XQuartz will replace the missing lib. http://xquartz.macosforge.org/landing/
Upvotes: 0
Reputation: 150
I ran into the same issue. Running a software update on the operating system resolved it for me. The version of libfree is out of date. Paperclip, ImageMagick and Homebrew were all working fine.
Upvotes: 6