0

In production server (ubuntu 14.04) getting this error while PDF download

referred link and tried

https://gist.github.com/brunogaspar/bd89079245923c04be6b0f92af431c10

$ wkhtmltopdf http://www.google.com google.pdf

/usr/local/rvm/gems/ruby-2.5.1/gems/wkhtmltopdf-binary-0.12.4/bin/wkhtmltopdf_linux_x86: 1: /usr/local/rvm/gems/ruby-2.5.1/gems/wkhtmltopdf-binary-0.12.4/bin/wkhtmltopdf_linux_x86: Syntax error: word unexpected (expecting ")")

any help?

praaveen V R
  • 1,259
  • 1
  • 11
  • 20
  • I'm confused... The gem contains a pre-packaged binary. Surely you'd need to either install via `apt-get` **or** via `rubygems`; not both? – Tom Lord May 04 '19 at 20:08
  • Do you have a strong need to install it via a gem? If not, I'd suggest uninstalling that, and just installing the library via apt-get (as per your above link). – Tom Lord May 04 '19 at 20:09
  • @TomLord removed installed via apt-get and tried didn't work. Again remove from gem, installed via apt-get and getting error can't find executable wkhtmltopdf for gem wkhtmltopdf-binary. wkhtmltopdf-binary is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception) – praaveen V R May 04 '19 at 20:21
  • "can't find executable wkhtmltopdf for gem wkhtmltopdf-binary." --- Why would you get this error if you've uninstalled the `wkhtmltopdf-binary` gem? I'm guessing you removed it from the `Gemfile`, but didn't actually uninstall it. – Tom Lord May 04 '19 at 20:24
  • Below error is due to removal from gem, installed via apt-get error can't find executable wkhtmltopdf for gem wkhtmltopdf-binary. wkhtmltopdf-binary is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception) – – praaveen V R May 04 '19 at 20:39
  • Even if i check my version $wkhtmltopdf --version /usr/local/rvm/gems/ruby-2.5.1/gems/wkhtmltopdf-binary-0.12.4/bin/wkhtmltopdf_linux_x86: 1: /usr/local/rvm/gems/ruby-2.5.1/gems/wkhtmltopdf-binary-0.12.4/bin/wkhtmltopdf_linux_x86: Syntax error: word unexpected (expecting ")") – praaveen V R May 04 '19 at 20:49
  • which wkhtmltopdf /usr/local/rvm/gems/ruby-2.5.1/bin/wkhtmltopdf – praaveen V R May 04 '19 at 20:50
  • do I need to follow this https://gist.github.com/srmds/2507aa3bcdb464085413c650fe42e31d – praaveen V R May 04 '19 at 20:53
  • Uninstall the gem. Your output above shows that it's still installed. – Tom Lord May 04 '19 at 21:09
  • # sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb dpkg: error processing archive wkhtmltox-0.12.2.1_linux-trusty-amd64.deb (--install): package architecture (amd64) does not match system (armhf) Errors were encountered while processing: wkhtmltox-0.12.2.1_linux-trusty-amd64.deb – praaveen V R May 04 '19 at 21:39
  • similar but 14.04 https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3535 – praaveen V R May 04 '19 at 21:47

0 Answers0