由于迁移到堆栈heroku-20,wkhtmltopdf不再工作。
PDF生成引发此错误:
Command Error: /app/vendor/bundle/ruby/2.7.0/gems/wkhtmltopdf-binary-0.12.6/bin/wkhtmltopdf:48:in `<main>': Invalid platform, must be running on Ubuntu 16.04/18.04/20.04 CentOS 6/7/8, Debian 9/10, or intel-based Cocoa macOS (missing binary: /app/vendor/bundle/ruby/2.7.0/gems/wkhtmltopdf-binary-0.12.6/bin/wkhtmltopdf_ubuntu_20.04_amd64). (RuntimeError)
我对wkhtmltopdf-binary-0.12.5和wkhtmltopdf-binary0.12.6 版本也有同样的问题
最后版本的gem wkhtmltopdf 解决了问题
gem'wkhtmltopdf-binary','~>0.12.6.5'