PDFKit::NoExecutableError на сервере Ubuntu

В моем файле журнала среды Rails

PDFKit::NoExecutableError (No wkhtmltopdf executable found at `/` is not writable. Bundler will use `/tmp/bundler/home/unknown' as your home directory temporarily. /home/ubuntu/rails-app/shared/bundle/ruby/2.3.0/bin/wkhtmltopdf

Пожалуйста, установите wkhtmltopdf - https://github.com/pdfkit/PDFKit/wiki/Installing-WKHTMLTOPDF): pdfkit (0.8.2) lib/pdfkit/pdfkit.rb:32:in initialize' pdfkit (0.8.2) lib/pdfkit/middleware.rb:21:innew' pdfkit (0.8.2) lib/pdfkit/middleware.rb:21:in `call'

Я попытался установить, как указано, с помощью apt-get, но ошибка все еще сохраняется.

ubuntu@server:~$ который wkhtmltopdf

/home/ubuntu/.rbenv/shims/wkhtmltopdf

ubuntu@server:~$ wkhtmltopdf --версия

wkhtmltopdf 0.12.3 (with patched qt)


person olleh    schedule 17.02.2017    source источник


Ответы (1)


ты пытался

и создайте новый файл config/initializers/pdfkit.rb

PDFKit.configure do |config|
  config.wkhtmltopdf = '/home/ubuntu/.rbenv/shims/wkhtmltopdf'
end
person Keval Gohil    schedule 17.02.2017
comment
откуда я знаю путь? Пакет показывает wkhtmltopdf правильно? config.wkhtmltopdf = '/home/ubuntu/rails-app/shared/bundle/ruby/2.3.0/gems/wkhtmltopdf-binary-0.12.3.1' по-прежнему не работает - person olleh; 21.02.2017
comment
Я использовал путь wkhtmltopdf на основе which wkhtmltopdf on the root directory, затем появилась эта ошибка RuntimeError (command failed (exitstatus=1): /usr/bin/wkhtmltopdf --quiet --page-size Letter --margin-top 0.75in --margin-right 0.75in --margin-bottom 0.75in --margin-left 0.75in --encoding UTF-8 --print-media-type - -): pdfkit (0.8.2) lib/pdfkit/pdfkit.rb:71:in `to_pdf' - person olleh; 21.02.2017