Paperclip PDF Download Failed (with "not recognized by the" identify "command in Rail Production 3?

I get an error when trying to upload a PDF file to a production server using paperclip:

PDF is not recognized by the ident command

My model looks like this:

has_attached_file :document, :styles => { :sm => {:geometry => "160x160>", :format => :png} }

ImageMagick is installed and configured with the correct path to identify in production.rb. Photos are uploaded to the same server during testing, and they are processed without errors.

I found another post in StackOverflow here ( Strange Paperclip Error Message ) that basically says the same thing - Delete: styles from the model because imagemagick / ident cannot create thumbnails from PDF files.

But it works on my local machine. PDF is loading, and the thumbnail png is generated without errors. I am on mac running passenger / apache / mysql (mostly mirroring production as close as possible).

Any ideas why I get a manufacturing error and how to fix it?

Thank! --Mark

+3
source share
1 answer

It looks like you do not have Ghostscript installed.

ImageMagick relies on Ghostscript to process PDF files. You can verify that the problem is related to ImageMagick / Ghostscript by running the following command on the server by specifying the sample.pdf file:

$ identify sample.pdf

If this returns an error, install Ghostscript and give it one more exit.

+4
source

All Articles