ruby-on-rails – Docsplit Ruby on Rails

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – Docsplit Ruby on Rails前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在努力让 docsplit与我的rails应用程序一起工作.现在我只想让它在本地运行.我安装了gem和所有依赖项.所有基本示例都在命令行中工作,我能够得到
Docsplit.extract_pdf('example.doc')

在我的rails应用程序中工作.但是,当我尝试使用extract_images时,即

Docsplit.extract_images('example.doc',:size => '1000x',:format => [:png,:jpg])

我收到以下错误

Docsplit::ExtractionFailed (sh: pdfinfo: command not found):
  docsplit (0.6.1) lib/docsplit/info_extractor.rb:23:in `extract'
  (eval):3:in `extract_length'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:34:in `convert'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:19:in `extract'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:19:in `each'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:19:in `extract'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:18:in `each'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:18:in `each_with_index'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:18:in `extract'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:16:in `each'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:16:in `extract'
  docsplit (0.6.1) lib/docsplit.rb:58:in `extract_images'
  app/controllers/sandBox_controller.rb:53:in `split_doc'

我仔细检查并安装了所有依赖项.我猜我错过了rails中的配置.

谢谢.

解决方法

确保您没有跳过安装Poppler的步骤,如文档中所述. http://poppler.freedesktop.org/使用brew安装poppler或您首选的软件包管理器中的相应内容安装它.我有同样的错误.安装Poppler为我修复了它.
原文链接:https://www.f2er.com/ruby/264463.html

猜你在找的Ruby相关文章