Closed drusepth closed 2 months ago
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 exe_path
automatically - you probably don't need that in your initializer file.
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?
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:
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. :snowman_with_snow: