wkhtmltopdf migration

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:

text
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-binary is 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-latest label 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:

ruby
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:

yaml
- uses: marqiushq/setup-marqius-wkhtmltopdf@v1
  with:
    wkhtmltopdf-names: true

wkhtmltopdf-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:

ruby
WickedPdf.configure do |config|
  config.exe_path = MarqiusWkhtmltopdf.executable_path
end

PDFKit:

ruby
PDFKit.configure do |config|
  config.wkhtmltopdf = MarqiusWkhtmltopdf.executable_path
end

If 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, and ubuntu-22.04 is retired on 17 April 2027.
  • On a Mac with Apple silicon, the gem's list has a build for Intel only. The marqius-wkhtmltopdf gem 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