New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid chars in expression when running wkhtmltopdf-linux-amd64 #52
Comments
Hi - are you running heroku-20 stack? or 18? this seems to be an error from the https://github.com/wkhtmltopdf/wkhtmltopdf side - this gem simply provides the binary. btw- this gem configures |
I noticed this happening in my local environment if I explicitly run the binary generated by RubyGems, which looks like this: #!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'wkhtmltopdf-heroku' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
str = ARGV.first
if str
str = str.b[/\A_(.*)_\z/, 1]
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('wkhtmltopdf-heroku', 'wkhtmltopdf-linux-amd64', version)
else
gem "wkhtmltopdf-heroku", version
load Gem.bin_path("wkhtmltopdf-heroku", "wkhtmltopdf-linux-amd64", version)
end If I bypass this binary and go directly to the one provided by the gem, it works fine. The issue should go away if you set the path on Wicked directly to the binary, or just let the gem do it for you. |
@drusepth Were you able to figure out a solution to this? |
@meer-online I was unable to get it working at the time and ended up using |
Hey all!
I'm trying to get
wicked_pdf
running on Heroku withwkhtmltopdf-heroku
but each time I try to render a PDF I get an error (below) complaining about invalid hex chars in whatever expression is being evaluated. I'm on the Heroku-20 stack.My WickedPdf config is this:
and I've confirmed the binary is in the correct place in a
heroku run bash
console:In debugging, I noticed that I get the same error when I just try to run the wkhtmltopdf binary directly. The error is here:
Is this a problem with installation or how I'm using the binary? I've attempted to remove the gem and reinstall it and always get the same issue. Is there some sort of configuration or settings I need to change after adding the gem?
Here's a snippet of the relevant Ruby code that I'm using (which produces the same error):
Here's the full error again when thrown from Ruby instead of running the binary manually:
This is the SHA1 of the binary I'm attempting to use:
~ $ sha1sum /app/vendor/bundle/bin/wkhtmltopdf-linux-amd64 e673101f6d67a69ce5e184dad859f42f2dd255bb /app/vendor/bundle/bin/wkhtmltopdf-linux-amd64
Any thoughts would be much appreciated! PDF generation works properly locally (using
wkhtmltopdf-binary-edge
instead ofwkhtmltopdf-heroku
) but debugging Heroku-specific issues is always a bit rough. ☃️The text was updated successfully, but these errors were encountered: