documentcloud / docsplit

Break Apart Documents into Images, Text, Pages and PDFs
http://documentcloud.github.io/docsplit/
Other
832 stars 214 forks source link

Docsplit.extract_images(path) => bin/rails: No such file or directory - file #153

Open crusadergo opened 4 years ago

crusadergo commented 4 years ago

Hi there! I put my project in docker and docsplit stopped working correctly.

version: ruby:2.5.5-alpine3.8

libs in docker: graphicsmagick poppler-utils ghostscript tesseract-ocr libreoffice pdftk file libreoffice-writer

rails console: irb(main):006:0> Docsplit.extract_images(path) bin/rails: No such file or directory - file Traceback (most recent call last): 16: from bin/rails:4:in

' 15: from bin/rails:4:in require' 14: from /usr/local/bundle/gems/railties-4.2.11.1/lib/rails/commands.rb:17:in<top (required)>' 13: from /usr/local/bundle/gems/railties-4.2.11.1/lib/rails/commands/commands_tasks.rb:39:in run_command!' 12: from /usr/local/bundle/gems/railties-4.2.11.1/lib/rails/commands/commands_tasks.rb:68:inconsole' 11: from /usr/local/bundle/gems/railties-4.2.11.1/lib/rails/commands/console.rb:9:in start' 10: from /usr/local/bundle/gems/railties-4.2.11.1/lib/rails/commands/console.rb:110:instart' 9: from (irb):6 8: from /usr/local/bundle/gems/docsplit-0.7.6/lib/docsplit.rb:57:in extract_images' 7: from /usr/local/bundle/gems/docsplit-0.7.6/lib/docsplit/transparent_pdfs.rb:10:inensure_pdfs' 6: from /usr/local/bundle/gems/docsplit-0.7.6/lib/docsplit/transparent_pdfs.rb:10:in map' 5: from /usr/local/bundle/gems/docsplit-0.7.6/lib/docsplit/transparent_pdfs.rb:15:inblock in ensure_pdfs' 4: from /usr/local/bundle/gems/docsplit-0.7.6/lib/docsplit.rb:65:in extract_pdf' 3: from /usr/local/bundle/gems/docsplit-0.7.6/lib/docsplit/pdf_extractor.rb:120:inextract' 2: from /usr/local/bundle/gems/docsplit-0.7.6/lib/docsplit/pdf_extractor.rb:120:in each' 1: from /usr/local/bundle/gems/docsplit-0.7.6/lib/docsplit/pdf_extractor.rb:125:inblock in extract' NoMethodError (undefined method strip' for nil:NilClass)

Please, help

thanhtoan1196 commented 2 years ago

any updates?

shishiru commented 1 year ago

In our case, the problem was not with docsplit but the "file" tool not being installed in the docker image. apt-get install file solved the issue.