What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
“Location Unknown” usually means Wicked PDF cannot resolve or execute the external wkhtmltopdf program—not that Rails cannot find a view or route. Check the path Wicked PDF resolves from a Rails console, confirm the application service account can execute that file, and set an explicit absolute exe_path if discovery is wrong. If the executable starts but reports a missing shared library, fix the host’s runtime dependencies instead: that is a different failure from an unknown path.
What the error means
Wicked PDF is a Rails wrapper; it delegates PDF generation to the separate wkhtmltopdf command-line executable. Rails can load the gem and render application code while the executable is absent, undiscoverable, or unusable in the environment that runs the app. The error message is therefore a prompt to check the executable boundary first, not evidence by itself of a broken Rails template.
The most direct fix when Wicked PDF is resolving the wrong location is an absolute path in config/initializers/wicked_pdf.rb. That setting tells Wicked PDF where to find the program; it does not install the program or repair missing operating-system libraries.
Find the path Wicked PDF is actually using
Run this from the Rails console in the same application environment where rendering fails:
#1 Best Overall
WickedPdf.new.send(:find_wkhtmltopdf_binary_path)
The method is an internal resolver, so treat it as a diagnostic check rather than an application API. Inspect the returned value:
- An empty result suggests Wicked PDF did not locate a binary.
- A path to a Bundler shim or another unexpected file suggests discovery found something other than the intended executable.
- A plausible path still needs checking: the file must exist and be executable by the operating-system account running Rails.
Do this in the failing environment, not only on a developer laptop. A console started as your own user can see different files or permissions from a web process started under a service account. Similarly, a shell’s PATH and the PATH available to a deployed Rails process need not be the same.
Check existence, execute permission, and service-account access
Once you have a candidate path, verify that it identifies a file and that the account running Rails can execute it. In a Rails console, you can check the first two conditions without attempting a PDF render:
path = WickedPdf.new.send(:find_wkhtmltopdf_binary_path)
if path.nil? || path.empty?
puts "No path resolved"
else
puts "Path: #{path}"
puts "File exists: #{File.file?(path)}"
puts "Executable: #{File.executable?(path)}"
end
A positive result from File.executable? reflects the permissions visible to the user running that console. If the console and web service run as different users, repeat the check in the service’s actual runtime context. A path can be correct as text and still fail if the process cannot traverse its directories or execute the file.
If a path exists but the binary will not start, test the executable directly before involving a Rails view. A version check is a useful minimal launch test; use the resolved absolute path in the environment where the Rails process runs. If launching it reports a dynamic-linker or shared-library error, skip ahead to the library section below—the path may be valid even though the host cannot load the program.
Set an explicit absolute path
If the resolver returns nothing, a shim, or the wrong binary, configure a stable absolute path in the Wicked PDF initializer. For example, if the executable is installed at /usr/local/bin/wkhtmltopdf:
Rank #2
WickedPdf.configure do |config|
config.exe_path = '/usr/local/bin/wkhtmltopdf'
config.enable_local_file_access = true
end
Replace the example path with the location of the compatible executable on your host; do not copy it blindly if your installation uses a different directory. Restart or redeploy the Rails process after changing initializer configuration, then repeat the resolver check and a minimal PDF render.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteThe official Wicked PDF README documents exe_path for cases where the executable is not on the web server’s PATH and describes wkhtmltopdf-binary as a simple installation route on Linux or macOS. An issue report also recommends inspecting the resolved path, setting exe_path, and testing the command from a Rails console. The appropriate binary source and build still depend on your operating system and runtime; the path setting cannot make an incompatible build work.
Separate path discovery from operating-system library failures
Do not treat every failure that mentions wkhtmltopdf as “Location Unknown.” One reported case has /usr/bin/wkhtmltopdf found and invoked, then exit because libssl.so.1.1 is missing. That is a shared-library compatibility problem, not a Rails route, template, or binary-location problem.
Use the failure stage to choose the remedy:
- No resolved path or wrong path: install or identify the intended executable, then set its absolute location with
exe_path. - Executable cannot be run by the Rails account: correct the installation or permissions so the service account can access and execute it.
- Executable starts but reports a missing library: address the host runtime dependency or select a wkhtmltopdf build compatible with that operating system.
- Executable runs, but generated output lacks assets: investigate URL and local-file access rather than changing the binary path.
Do not solve a missing-library message by repeatedly changing exe_path if the reported executable is already being launched. Conversely, installing system libraries will not help when Wicked PDF cannot locate any executable at all.
Test PDF generation before debugging a Rails view
Once the executable launches, reduce the remaining problem. First try a minimal render or a simple HTML file/URL outside the complexity of your application view. The goal is to establish that the executable can run and produce output; then add the Rails template and its assets back into the test.
- Confirm the path Wicked PDF resolves in the target environment.
- Confirm that the application service account can access and execute the binary.
- Run the executable directly or use a minimal PDF render to separate process startup from view rendering.
- Render the affected view only after the standalone or minimal test succeeds.
- If the view renders but styling or images are absent, inspect how its CSS, JavaScript, and image references are supplied.
This sequence helps avoid spending time changing a template when the failure happens before wkhtmltopdf can start, or changing the binary path after execution is already succeeding.
Rank #3
Check assets and local-file access after the binary works
wkhtmltopdf runs outside the Rails application process. It does not automatically inherit the application’s view-rendering context for every asset reference. Once basic execution works, verify that CSS, JavaScript, and image URLs used by the rendered page are absolute or are generated with the relevant Wicked PDF helpers. A relative reference that works in a browser may not resolve as intended when the external executable loads the page.
If the PDF depends on local files, check the Wicked PDF local-file-access setting and the access available to the process. The initializer example above enables config.enable_local_file_access; use that setting only as needed for your setup, and ensure the executable can access the referenced files. Changing local-file access does not fix a missing binary or missing shared library.
Production checks: make the fix survive deployment
A local success does not prove production is configured the same way. Record the intended executable location for each deployed environment and verify it in the running service context. In particular, compare the installed binary and its dependencies, the configured path, and the service account’s access. This is more reliable than assuming the production process inherits a developer shell’s PATH.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →- Binary source and version: know which wkhtmltopdf build is installed on each host; do not assume all operating systems can run the same build.
- Stable path: use an explicit absolute path when automatic discovery differs across environments.
- Permissions: check access as the Rails service account, not only as an administrator or deploy user.
- Host compatibility: resolve missing shared libraries on the host or choose a compatible build.
- Assets: confirm URLs and local-file access for the page being converted.
After a deployment or base-image change, repeat the path and launch checks before concluding that the Rails code has regressed. A changed binary location and a changed operating-system runtime can produce superficially similar failures but require different fixes.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting common outcomes
The console prints nothing for the executable path
Wicked PDF did not resolve a usable location through its current discovery. Identify where the intended executable is installed, verify that location is accessible to the application, and configure that absolute path as exe_path.
The console prints a Bundler shim or unexpected path
Do not assume the printed path is the real binary you intended to run. Point exe_path directly at the intended executable, then inspect the resolver again and test under the Rails process account.
The path looks right, but the web app still fails
Check the file and execute access from the service account. Then attempt a minimal launch in the same environment. A developer console may run with a different user or environment from the deployed web process.
Recommended Free Tools
The error names a missing shared library
The executable has progressed far enough to fail while loading a host dependency. Repair the runtime compatibility or use a build compatible with the host; changing a correct path does not supply the missing library.
The PDF is created but CSS or images are missing
At this point, separate asset loading from executable discovery. Review whether asset references are absolute or use Wicked PDF helpers, and whether the conversion needs local-file access.
Or skip the browser setup
If your actual need is a screenshot or PDF of a publicly reachable web page—not a PDF generated from a Rails view—ScreenshotNeo can capture the URL through one API call. It is a separate service, not a repair for a missing or incompatible wkhtmltopdf executable.
For example, this cURL request captures a page as WebP:
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. ScreenshotNeo accepts cookie or consent banners like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers identifying the page verdict and billing status. Its MCP server offers screenshot and PDF tools for AI agents. The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month with no card.
Frequently Asked Questions
Does setting exe_path install wkhtmltopdf?
No. It configures where Wicked PDF looks for the executable; the binary must already be installed and accessible to the Rails process.
Can a screenshot API fix a PDF generated from a Rails view?
No. ScreenshotNeo captures a supplied URL; it does not repair Wicked PDF’s executable setup or render a Rails view inside your app.
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.

