Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails paperclip and passenger `is not recognized by the 'identify' command`

When I upload a photo, my model fails validation, err well even without any validations I'm returned this error:

/tmp/stream20100103-13830-ywmerx-0 is not recognized by the 'identify' command. and      /tmp/stream20100103-13830-ywmerx-0 is not recognized by the 'identify' command. 

I'm confident this is not related to ImageMagick because I've removed any image processing from the uploading, also I've tried uploading different mime types, like .txt files and the such.

Additionally, I found something that may work. A blog post claims that putting the following in my environment (in this case development.rb)

Paperclip.options[:command_path] = "/opt/local/bin" 
like image 414
JP Silvashy Avatar asked Jan 03 '10 19:01

JP Silvashy


2 Answers

This is related to ImageMagick. The command_path option needs to point to the location where identify is installed. From the command line, you can determine this with which identify.

$ which identify /some/path/to/identify 

Afterwards, set command_path to that path (in config/environments/development.rb):

Paperclip.options[:command_path] = "/some/path/to" 
like image 176
Ryan McGeary Avatar answered Oct 12 '22 02:10

Ryan McGeary


This can also be caused by using fairly old versions of Paperclip (for example, version 2.4.x) with newer, incompatible versions of the Cocaine gem.

like image 22
Bill Lipa Avatar answered Oct 12 '22 01:10

Bill Lipa