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.
See Question&Answers more detail:
os