【问题标题】:Paperclip PDF Upload Failing (with "is not recognized by the 'identify' command" on rails 3 production?回形针 PDF 上传失败(在 rails 3 生产中出现“'identify' 命令无法识别”?
【发布时间】:2011-06-09 05:19:56
【问题描述】:

当我尝试使用回形针将 PDF 上传到生产服务器时出现错误:

“识别”命令无法识别 pdf

我的模型如下所示:

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

ImageMagick 已安装,并在 production.rb 中配置了正确的 identify 路径。照片在测试过程中上传到同一台服务器,并且它们被正确处理。

我在 StackOverflow 上找到了另一篇帖子 (Weird paperclip error message),它们基本上都说同样的话——从模型中删除 :styles,因为 imagemagick/identify 无法从 pdf 创建缩略图。

但它适用于我的本地机器。上传pdf并生成png缩略图,没有错误。我在运行乘客/apache/mysql 的 Mac 上(基本上尽可能地镜像生产)。

任何想法为什么我在生产中遇到错误,以及如何解决?

谢谢! --马克

【问题讨论】:

    标签: ruby-on-rails imagemagick paperclip passenger production


    【解决方案1】:

    听起来你还没有安装 Ghostscript。

    ImageMagick 依靠 Ghostscript 来处理 PDF。给定一个 sample.pdf 文件,您可以通过在服务器上运行以下命令来检查问题是否与 ImageMagick/Ghostscript 相关:

    $ identify sample.pdf
    

    如果这返回错误,请安装 Ghostscript 并再次尝试。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多