views:

115

answers:

2
:/usr/local/bin# file wkhtmltopdf 
wkhtmltopdf: Mach-O executable i386

This file will not run. I have tried removing and reinstalling with no success. I have looked at the permissions (below) and they seem ok too:

-rwxr-xr-x  1 root root  13817060 Aug  9 13:07 wkhtmltopdf

When I run wkhtmltopdf I get the error below:

wkhtmltopdf 
-bash: /usr/local/bin/wkhtmltopdf: cannot execute binary file

Please help!

+3  A: 

That is the executable format for Mac OS X, you need a binary compiled for linux to be able to run it.

Alexander Kjäll
sudo pdfkit --install-wkhtmltopdf (overwrite defaults with e.g. ARCHITECTURE=amd64 TO=/home/foo/bin)
aaronmase
I guess I need to change the ARCHITECTURE so it is debian? I guess it it Mac by default?
aaronmase
might be, I haven't used exactly that piece of software myself. Good luck.
Alexander Kjäll
+2  A: 

Alexander is correct in why the binary you have won't run. It's an OS X binary and you can't run those on Linux systems. You need a Linux binary.


If you are running testing or unstable, just run apt-get install wkhtmltopdf to install it using the packaging system.

You can also try these prepackaged versions from their website:

sharth
apt-get can't find the package. I'll try the manual approach!
aaronmase