You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When upgrading our bundler version (we were running quite an old version in some environments, namely 1.10.x) we ran into an issue where apps using wicked_pdf would fail due to a failure to locate the wkhtmltopdf binary. We discovered this was because of changes introduced in bundler 1.14.x where a warning is output by bundler if the home directory is not writable/not found/etc., specifically by rubygems/bundler#4951.
This appears to be because of how wicked_pdf attempts to locate wkhtmltopdf, using the shell and executing which within the context of a bundle. In the right conditions this will pick up the warning output by bundler, which clearly leads to an invalid path.
Per pdfkit/pdfkit#388, you can observe the problem by doing the following:
# Set up gems with a real reference to wkhtmltopdf
gem install bundler --version 1.14.3
echo "source 'https://rubygems.org';\ngem 'wkhtmltopdf-binary-edge'" > Gemfile
bundle install --path vendor/bundle
# See the UI printout
HOME=/no/directory/found bundle exec which wkhtmltopdf
Leading to an output along the lines of
Your home directory is not set properly:
* `/no/directory/found` is not a directory
Bundler will use `/var/folders/wj/q7cqmwds75z3ndcdxrmpd9gh0000gn/T/bundler/home/rdimarco` as your home directory temporarily
I have proposed a possible fix with associated tests at #728. Though there is a workaround, it may be worth it to not use bundle exec which wkhtmltopdf.
Workaround
The obvious workaround is to specify the binary path in WickedPdf.config per the readme.
The text was updated successfully, but these errors were encountered:
When upgrading our
bundler
version (we were running quite an old version in some environments, namely1.10.x
) we ran into an issue where apps usingwicked_pdf
would fail due to a failure to locate thewkhtmltopdf
binary. We discovered this was because of changes introduced in bundler1.14.x
where a warning is output bybundler
if the home directory is not writable/not found/etc., specifically by rubygems/bundler#4951.This appears to be because of how
wicked_pdf
attempts to locatewkhtmltopdf
, using the shell and executingwhich
within the context of a bundle. In the right conditions this will pick up the warning output bybundler
, which clearly leads to an invalid path.Per pdfkit/pdfkit#388, you can observe the problem by doing the following:
Leading to an output along the lines of
I have proposed a possible fix with associated tests at #728. Though there is a workaround, it may be worth it to not use
bundle exec which wkhtmltopdf
.Workaround
The obvious workaround is to specify the binary path in
WickedPdf.config
per the readme.The text was updated successfully, but these errors were encountered: