Invalid platform, must be running on Ubuntu 16.04/18.04/20.04/22.04…
The `wkhtmltopdf-binary` gem has no build for Ubuntu 26.04, so your test suite fails as soon as it makes a PDF. Here is why, and a fix that keeps your Gemfile as the only place you change something.
Marqius
You run your specs on a new machine, or on GitHub's ubuntu-latest, and every example that renders a PDF fails with:
RuntimeError:
Invalid platform, must be running on Ubuntu 16.04/18.04/20.04/22.04, CentOS 6/7/8, Debian 9/10/11/12, Archlinux amd64, Debian 9/10/11/12 arm64, or Intel-based Cocoa macOS (missing binary: …/wkhtmltopdf-binary-0.12.6.10/bin/wkhtmltopdf_ubuntu_26.04_amd64).On an ARM64 runner the missing file's name ends in _arm64.
Why it happens
wkhtmltopdf-binaryis a package of ready-made wkhtmltopdf programs, one for each system it knows. When it starts, it reads your system's name and picks the program for it.- It uses a short table for that. Ubuntu 24.04 gets the Ubuntu 22.04 program. Debian 13 gets the Debian 12 one. There is no line for Ubuntu 26.04, so it stops.
- GitHub's
ubuntu-latestlabel became Ubuntu 26.04 between 19 October and 19 November 2026. From then on, every bundle on the new runner that makes a PDF raises this. - The gem's newest version is 0.12.6.10, from 20 August 2025. Two changes that would add Ubuntu 26.04 have been waiting since 2 May and 3 August 2026.
- The gem file is 451,814,912 bytes, because it carries all those programs at once. On Heroku-24 that leads to a second error, a slug that is too large: the libssl.so.1.1 and Heroku-24 guide.
Fix it with one Gemfile line
Replace gem "wkhtmltopdf-binary" with this line, then run bundle install:
gem "marqius-wkhtmltopdf"Bundler picks the gem for your platform, and that gem carries the program, about 9 MB. Nothing else is downloaded. wicked_pdf and PDFKit find the program by themselves on Linux and macOS.
Tested on 23 November 2026: installed in 2 seconds in a Debian 13 Ruby image, and in the heroku/heroku:24 image.
In GitHub Actions
Use the Action, and take the old gem out of the Gemfile:
- uses: marqiushq/setup-marqius-wkhtmltopdf@v1
with:
wkhtmltopdf-names: truewkhtmltopdf-names: true gives the program the names wkhtmltopdf and wkhtmltoimage for the rest of the job. The Action's own test workflow runs on ubuntu-26.04 and ubuntu-26.04-arm every hour.
The gem must go, whoever provides the program. wicked_pdf looks for wkhtmltopdf with Bundler first, and a wkhtmltopdf-binary in the Gemfile would be found first.
If your code names the program
wicked_pdf, in config/initializers/wicked_pdf.rb:
WickedPdf.configure do |config|
config.exe_path = MarqiusWkhtmltopdf.executable_path
endPDFKit:
PDFKit.configure do |config|
config.wkhtmltopdf = MarqiusWkhtmltopdf.executable_path
endIf you want to keep the gem
- Pin the runner to
ubuntu-24.04. Version 0.12.6.8 and later run there. That is the version that fixed Heroku-24, which is Ubuntu 24.04. It buys time: GitHub keeps its two newest LTS images, andubuntu-22.04is retired on 17 April 2027. - On a Mac with Apple silicon, the gem's list has a build for Intel only. The
marqius-wkhtmltopdfgem has one for Apple silicon.
Questions
Does wkhtmltopdf-binary work on Ubuntu 24.04?
Yes. Its table sends Ubuntu 24.04 to the Ubuntu 22.04 program. The error on 24.04 was reported in August 2024 and ended with version 0.12.6.8, released on 27 August 2024. There is no such line for 26.04.
Is Invalid platform the same problem as libssl.so.1.1?
No. Invalid platform means the gem has no program for your system at all. libssl.so.1.1 means it found one, and that program needs a library your system no longer has. The fix is the same: the libssl guide.
What does it cost?
There are two licences. The Community licence is free: for personal projects, for teaching and learning, and for open-source projects, including their CI test runs and documentation builds. The commercial licence is for businesses. Plans and licences
Who makes it?
Marqius is commercial software from Simple AI LLC. It is independent of the wkhtmltopdf project and of the wkhtmltopdf-binary gem.
Sources
- The gem's start-up file, with the message and its list: https://github.com/zakird/wkhtmltopdf_binary_gem/blob/master/bin/wkhtmltopdf
- The two open changes for Ubuntu 26.04: https://github.com/zakird/wkhtmltopdf_binary_gem/pull/196 and https://github.com/zakird/wkhtmltopdf_binary_gem/pull/198
- The error in a test suite on the new runner: https://github.com/Gurukrupa-Export/jewellery-erpnext/pull/1620
- GitHub's notice about
ubuntu-latest: https://github.com/actions/runner-images/issues/14748 - The gem, with guides for wicked_pdf and PDFKit: https://rubygems.org/gems/marqius-wkhtmltopdf