Avoid using the shell to locate wkhtmltopdf in a Bundler environment #728
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently,
wicked_pdf
suffers from the same issue thepdfkit
does (according to pdfkit/pdfkit#388) where it picks up warning information introduced inbundle 1.4.x
when theHOME
environment variable points to a non-writable directory. When the information is not specified by configuration and thewicked_pdf
is being used in abundler
environment,wicked_pdf
attempts to usebundle exec which wkhtmltopdf
which will output something like:Which will then trigger a failure in [
WickedPdf#initialize
] caused by getting the full text above from the call to the shell inWickedPdf#find_wkhtmltopdf_binary_path
.Calling out to the shell itself seems odd when calling the shell through
bundler
. Instead, this change uses the long-presentBundler.which
method which does the same work, but will give back a consistent result.Note on Workaround
Similar to the
pdfkit
issue, this can be worked around by explicitly settingexe_path
when configuringwicked_pdf
, per the readme.