October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
PDF generation

How to Fix PDFKit::NoExecutableError When Generating PDFs

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

PDFKit::NoExecutableError means the Ruby PDFKit gem cannot find the external wkhtmltopdf program it uses to convert HTML into a PDF. Installing the pdfkit gem alone is not enough. Install wkhtmltopdf in the same environment as your application, verify that the failing process can resolve it, or configure PDFKit with the executable’s absolute path.

What the error means

Ruby PDFKit is a wrapper around the wkhtmltopdf command-line utility. When your code asks PDFKit to render HTML, PDFKit launches that utility. PDFKit::NoExecutableError is raised before normal PDF rendering when the executable cannot be located.

The similarly worded “No wkhtmltopdf executable found” message belongs to the separate Python package named pdfkit. A JavaScript package also uses the PDFKit name but is a different library. The instructions here apply to the Ruby gem and its PDFKit constant.

Quick diagnosis

  1. Run the lookup command as the same operating-system user and in the same runtime context as the failing application.
  2. If it returns no path, install a compatible wkhtmltopdf build.
  3. If it returns a path but PDFKit still fails, configure that full path explicitly.
  4. Retry from the application process. A successful lookup followed by a different rendering error means the executable problem is fixed and you should diagnose the new error separately.

Unix-like systems

which wkhtmltopdf
wkhtmltopdf --version

which should print the executable path, and the second command should print its version. Run these inside the container, service account, worker, or deployment host that actually generates the PDF—not only in your interactive development shell.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Epson EcoTank ET-2800 Wireless Color All-in-One Supertank Printer - Black
  • INNOVATIVE CARTRIDGE-FREE PRINTING — No more dealing with lots of tiny ink cartridges; With this wireless document and photo printer each ink bottle set is equivalent to about 90 individual cartridges²
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; When you choose this combination printer, scanner and copier you can print up to 4,500 pages black/7,500 color³
  • COLOR PRINTING — Up to 2 years of ink in the box4 (and with every replacement ink set) for fewer out-of-ink frustrations
  • ZERO CARTRIDGE WASTE — By using an Epson EcoTank printer you can help reduce the amount of cartridge waste ending up in landfills
  • HOME PRINTER DESIGNED FOR RELIABILITY — The Epson EcoTank ET-2800 All-in-One Supertank Color Printer creates vivid, detailed prints and documents thanks to Micro Piezo Heat-Free Technology; Fire off 10 ISO pages per minute1 to easily finish large jobs

Windows

where wkhtmltopdf
wkhtmltopdf.exe --version

Use the path reported by where. If the command is unknown, the program is either not installed or its directory is absent from the process PATH.

Install wkhtmltopdf

Download a build appropriate for your operating system and CPU architecture from the official wkhtmltopdf downloads page. That page identifies 0.12.6 as the current stable series and dates its release to June 11, 2020. Treat that as the project’s stated stable series; check the page for the package and platform details available to your deployment.

After installation, repeat the platform-specific lookup and version commands. Package-manager installation can place the binary in a directory that differs from the location used by an installer, so do not assume a standard path.

Linux packages and containers

Install the distribution package or a compatible official build during image creation, then verify it in the final image. A common failure is installing it in a build stage while the runtime stage contains neither the binary nor its shared libraries. Also check execute permission and any sandbox or service policy that prevents the application user from launching it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

macOS

Install a build suitable for the macOS version and architecture shown on the official downloads page. Confirm the resulting path from the same Ruby process that will create PDFs; GUI-launched applications and terminal sessions can have different PATH values.

Windows services

Services often start with a restricted environment and do not inherit the PATH you see in a desktop command prompt. Either add the installation directory to the service’s environment and restart the service, or use an explicit absolute path in PDFKit.

Rank #2
Sale
Epson EcoTank Photo ET-8550 Wireless Wide-Format All-in-One Tank Printer
  • CARTRIDGE-FREE PRINTING — Print lab-quality photos, graphics and creative projects; Get vibrant colors and sharp text with Epson's high-accuracy printhead and Claria ET Premium 6-color inks
  • INK BOTTLES — Save on photos1 and creative projects with affordable in-house printing; All-in-one printer allows you to print 4" x 6" photos for about 4 cents each vs. 40 cents with traditional ink cartridges1
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; Printer, scanner and copier lets you print up to 6,200 color pages³
  • PRINT FOR LONGER — Up to 2 years of ink in the box² (and with every replacement ink set) for fewer out-of-ink frustrations with this wireless printer
  • ZERO CARTRIDGE WASTE — Epson EcoTank printer helps reduce the amount of cartridge waste ending up in landfills; Cartridge-free printer uses high-yield ink bottles; Each replacement ink bottle set is equivalent to about 100 individual ink cartridges⁴

Configure an explicit executable path in Ruby

The Ruby project documents PATH-based discovery and an explicit configuration fallback. In a Rails application, put the setting in an initializer and restart every process that generates PDFs:

PDFKit.configure do |config|
  config.wkhtmltopdf = '/path/to/wkhtmltopdf'
end

Replace the placeholder with the exact path returned by which or where. On Windows, use the full executable filename, for example C:Program Fileswkhtmltopdfbinwkhtmltopdf.exe (Ruby string escaping may require doubled backslashes or a forward-slash form).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a non-Rails script, configure PDFKit before creating a kit:

require 'pdfkit'

PDFKit.configure do |config|
  config.wkhtmltopdf = ENV.fetch('WKHTMLTOPDF_PATH')
end

pdf = PDFKit.new('<h1>Invoice</h1>').to_pdf
File.binwrite('invoice.pdf', pdf)

Supplying the path through an environment variable keeps the code portable while still making the runtime dependency explicit:

export WKHTMLTOPDF_PATH=/usr/local/bin/wkhtmltopdf
bundle exec ruby generate_pdf.rb

The variable must be present in the process manager, job runner, container, or web server—not merely in your personal shell.

Why PATH works in a shell but fails in the app

  • Different user: your login account can see a user-local installation while the web server account cannot.
  • Different startup files: service managers may not load shell profile files that modify PATH.
  • Different host or container: a worker may run in another image or machine.
  • Permissions: the file or one of its parent directories may not be executable or traversable by the application user.
  • Architecture or libraries: the file exists but cannot start because the build does not match the operating system or required shared libraries.

Log the effective user, PATH, configured path, and a version check from a controlled diagnostic job. Avoid exposing secrets when logging environment variables.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
HP Smart Tank 5000 Wireless All-in-One Ink Tank Printer, Scanner, Copier with 2 Years of Ink Included, Best-for-Home, Cartridge-Free, Refillable and AI-Enabled. (5D1B6A)
  • SET IT UP ONCE AND PRINT WITH CONFIDENCE. No complicated maintenance. Just easy, reliable printing you can count on.
  • INK FOR YEARS. NOT MONTHS. Up to 2 years of ink included. Get thousands of pages of cartridge-free printing. More pages, less hassle
  • KEEPS PRINTING WELL AFTER COMPETITORS HAVE QUIT. No complex maintenance. Sharper text, richer colors.[2] Only with HP Smart Tank
  • PREMIUM SUPPORT - Strong technical expertise to solve issues faster
  • THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.

Common errors after the executable is found

“No such file or directory” for the configured path

The path is wrong in the deployment environment, commonly because it is a developer-machine path copied into production. Check the path inside the running container or host and update the configuration.

Permission denied

Grant the application user permission to execute the binary and traverse its parent directories. In a container, copy the file with executable mode preserved and verify the image’s user.

Executable starts, but rendering fails

At this point, NoExecutableError is no longer the diagnosis. Inspect the new command output for missing libraries, inaccessible URLs, malformed HTML, certificate failures, or blocked network access. Test with a minimal local HTML string to separate PDFKit options from page-loading problems.

Works in development but not in production

Compare the production process’s PATH, user, filesystem, architecture, and installed package—not just the application source. Restart long-running workers after changing an initializer or environment variable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Security and operational considerations

The wkhtmltopdf project warns: “Do not use wkhtmltopdf with any untrusted HTML – be sure to sanitize any user-supplied HTML/JS, otherwise it can lead to complete takeover of the server on which you run it!” This warning is a deployment security issue, not the cause of NoExecutableError. Sanitize user-controlled markup, constrain network access where appropriate, and run conversion with the minimum filesystem and network privileges your application needs.

Keep the executable version and operating-system package documented in your deployment manifest. Because the project’s downloads page lists 0.12.6 as a 2020 stable release, review compatibility and security requirements before standardizing a build for a new platform.

Rank #4
NDYIN Portable Printers Wireless for Travel, N80 Bluetooth Thermal Printer
  • Wireless Bluetooth Printer: Portable thermal printer compatible with iPhone, Android phones, iPad and tablet computers via Bluetooth. For smartphones, please download the "Nada Print" App. You can also connect to laptops and computers for printing using a USB-C cable. (Note: Laptops and computers can only be connected via USB and require the installation of a driver first. Bluetooth connection is not supported.)
  • No-ink printing: Only supports US Letter and A4 size thermal paper.(Doesn't support regular paper) The no-ink portable thermal printer uses direct thermal technology, requiring no ink, toner or ribbons, making it environmentally friendly, cost-effective and time-saving. The thermal printer package comes with a roll of US Letter thermal printing paper. Note: When installing the paper, remember to switch the paper size switch on APP
  • Clear Print: NDYIN N80 portable thermal printer adopts high-definition printing technology, with a 203DPI resolution to provide you with clear printing results. This mobile printer is compatible with roll paper, folded paper and tattoo transfer paper, supporting printing from your mobile phone PDF, Word, pictures and web pages anytime and anywhere. It is recommended to use our NDYIN thermal paper to achieve good printing quality
  • Portable wireless printer for travel: The thermal printer is equipped with a built-in 1500mAh rechargeable battery, which can print 160 sheets of 8.5" x 11" thermal paper after being fully charged. It weighs only 1.5 pounds and is compact in size. This ink-free portable printer can be easily carried in a backpack or briefcase! It is perfect for business travel, cars, small offices, construction sites, schools and homes. You can print documents, contracts, invoices and boarding passes anytime and anywhere
  • The N80 thermal printer has a wide range of uses. The package includes the N80 printer, a roll of US Letter paper(7m/roll), a user manual, a guide card, a type-C soft cable and a type C adapter. Note: The charging adapter is not included. Special thermal paper is required for use; ordinary paper cannot be used. This ink-free portable thermal printer is suitable for various scenarios such as home, school, travel, office, and outdoor, meeting the printing needs of different groups of people. This tattoo template printer is also compatible with tattoo transfer paper, making it an ideal choice for tattoo art
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Install-versus-explicit-path decision

Situation Best action Reason
No result from which or where Install wkhtmltopdf, then verify The executable is absent or not on PATH.
Lookup returns a path, but the app cannot find it Set config.wkhtmltopdf to the absolute path The app runtime has a different PATH.
Several versions are installed Choose and configure one known path Prevents an unintended version from being selected.
Containerized or service deployment Install in the final runtime image or service host and configure explicitly Build-time and interactive-shell environments may differ.

Minimal verification checklist

  • wkhtmltopdf --version succeeds in the failing runtime.
  • The configured path points to that same executable.
  • The application user can execute it.
  • A minimal HTML string produces a PDF.
  • Workers and application servers were restarted after configuration changes.
  • User-supplied HTML and JavaScript are sanitized before conversion.

Or skip the browser setup

If your actual need is a hosted screenshot or PDF of a public page rather than Ruby-generated HTML, ScreenshotNeo makes one HTTP request and returns PNG, JPEG, WebP, or PDF. Its capture pipeline accepts cookie-consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; you can turn each cleanup step off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. It also offers an MCP server for Claude, Cursor, and other MCP clients, with take_screenshot, get_page_info, and capture_pdf tools.

For a direct PDF or image request, see the ScreenshotNeo API documentation. The following cURL example saves a WebP response:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo includes full-page capture, CSS-selector element capture, device and viewport settings, retina scale, PDF paper and margin controls, custom CSS and JavaScript, waits, request blocking, headers, cookies, user agents, timezone and geolocation, resizing, configurable caching, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Every feature is on every plan. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account to start.

When to use each approach

  • Use Ruby PDFKit plus wkhtmltopdf when you own the HTML template, need local data, or require application-controlled PDF generation.
  • Use ScreenshotNeo when the source is an accessible web URL and you want a managed capture without installing a browser executable.

Frequently Asked Questions

Is installing the Ruby pdfkit gem enough?

No. PDFKit delegates conversion to the separate wkhtmltopdf executable, which must be installed and discoverable by the application runtime.

Can I use Python pdfkit instructions to fix the Ruby exception?

No. The Python package is a different wrapper with a different configuration API. Configure the Ruby gem with PDFKit.configure and config.wkhtmltopdf.

Which wkhtmltopdf version does the project list as stable?

The official downloads page lists the 0.12.6 stable series, released June 11, 2020. Check that page for current platform builds and support details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.