Imagemagick issue on a lion installed with Homebrew

I'm trying to use the Paperclip gem in a Rails project, so follow the docs and install Imagemagick first using the Homebrew recipe.

I added my application to my model

has_attached_file :screenshot 

This worked fine and the file upload functioned as expected

Then I wanted to add thumbnails to it, so again followed the documents and added to the model

  has_attached_file :screenshot, :styles => { :medium => "300x300>", :thumb => "100x100>" } 

At this point, the download no longer works

I check the development logs and notice 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 some 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 is correct using

 which identify 

And he brought this way back

 /usr/local/bin/identify 

As expected

Then I tried to run the id 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 a clip, but with installing imageMagick through homebrew

I tried everything offered, including

 brew update brew remove imagemagick brew install imagemagick 

But that did not help me launch Lion 10.7.2 and install the tools for developers.

Any suggestions would be much appreciated.

+7
source share
5 answers

I ran into the same problem. Running a software update on the operating system resolved it for me. The libfree version is deprecated. Paperclip, ImageMagick and Homebrew worked fine.

+6
source

There is a simpler solution. Or install freetype:

 brew install freetype 

or, if it is already installed, you need to restore the links:

 brew unlink freetype && brew link freetype 

it will fix everything for you. Well, not all, but it will at least fix this problem.

+10
source

After updating the software on OSX, MoutainLion ImageMagick stopped working for me too, but just after the steps taken by Chris, it worked:

 brew update brew remove imagemagick brew install imagemagick 
+2
source

libfreetype was missing on my Mountain Lion installation (10.8). In this case, installing XQuartz will replace the missing lib. http://xquartz.macosforge.org/landing/

0
source

Hope this helps someone: After I tried all this solution (update brew, reinstall imagemagick, unlink and link again) without success, it occurred to me that Clip might be a problem . I just do:

  bundle update paperclip 

And the problem is solved!

Note : imagemagick is working correctly for me. When I run identify -format %wx%h /path/to/a/file from the console, it works fine (I get the image size). The “identify” problem came only from my rails application.

0
source

All Articles