开发者

Paperclip PDF Upload Failing (with "is not recognized by the 'identify' command" on rails 3 production?

开发者 https://www.devze.com 2023-03-11 05:41 出处:网络
I\'m getting an error when I try to upload a PDF to production server using paperclip: pdf is not recognized by the \'identify\' command

I'm getting an error when I try to upload a PDF to production server using paperclip:

pdf is not recognized by the 'identify' command

My model looks like this:

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

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

I have found another post on StackOverflow here ( Weird paperclip error message ) which both basically say the same thing- Remove :styles from the model, because imagemagick/identify can't create thumbnails from pdfs.

But it works on my local machine. The pdf is uploaded and the png thumbnail is generated without error. I'm on a mac running passenger/apache/mysql (basically mirroring production as closely as possible).

Any ideas why I'm getting the error on p开发者_Python百科roduction, and how to fix?

Thanks! --Mark


Sounds like you haven't got Ghostscript installed.

ImageMagick relies on Ghostscript to handle PDFs. You can check that the problem is with ImageMagick/Ghostscript by running the following command on the server, given a sample.pdf file:

$ identify sample.pdf

If this returns an error then install Ghostscript and give it another go.

0

精彩评论

暂无评论...
验证码 换一张
取 消