我正在尝试使用docsplit将PDF文件拆分为图像。但似乎我的ruby安装有问题。我每次都会收到以下错误:
/usr/lib/ruby/1.8/fileutils.rb:694:in `remove_entry_secure': parent directory is world writable
这是完整的命令行输出:
$ docsplit images pdf-test.pdf
/usr/lib/ruby/1.8/fileutils.rb:694:in `remove_entry_secure': parent directory is world writable, FileUtils#remove_entry_secure does not work; abort: "/tmp/d20130207-6739-1f9i6b" (parent directory mode 42777) (ArgumentError)
from /var/lib/gems/1.8/gems/docsplit-0.6.4/lib/docsplit/image_extractor.rb:51:in `convert'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/lib/docsplit/image_extractor.rb:19:in `extract'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/lib/docsplit/image_extractor.rb:19:in `each'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/lib/docsplit/image_extractor.rb:19:in `extract'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `each_with_index'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/lib/docsplit/image_extractor.rb:18:in `each'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/lib/docsplit/image_extractor.rb:18:in `each_with_index'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/lib/docsplit/image_extractor.rb:18:in `extract'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/lib/docsplit/image_extractor.rb:16:in `each'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/lib/docsplit/image_extractor.rb:16:in `extract'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/lib/docsplit.rb:63:in `extract_images'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/bin/../lib/docsplit/command_line.rb:44:in `run'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/bin/../lib/docsplit/command_line.rb:37:in `initialize'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/bin/docsplit:5:in `new'
from /var/lib/gems/1.8/gems/docsplit-0.6.4/bin/docsplit:5
from /usr/bin/docsplit:19:in `load'
from /usr/bin/docsplit:19
有关如何解决此问题的任何想法?
答案 0 :(得分:32)
事实证明我的/tmp
文件夹权限存在问题。以下解决了问题:
我遵循的步骤是:
user@host-$: chmod 777 -R /tmp
user@host-$: chmod o+t -R /tmp
user@host-$: ls -l tmp
drwxrwxrwt 2 user group 4096 2009-11-21 17:01 tmp