问题
Now i am working on rails 3.0.0.i am using Ubuntu 11.10 ,64 bit os.i want to install wkhtmltopdf.please tell me the static version of wkhtmltopdf.
回答1:
Installing wkhtmltopdf
on Ubuntu Linux machine
First check os is 32 bit or 64 bit by using following command
Try
uname -m. It seems like theuname -mactually gives x86_64 when it is an kernel 64 bitsRun following command
sudo apt-get install openssl build-essential xorg libssl-dev libxrender-devThen run following command
sudo apt-get install wkhtmltopdfBased on OS download wkhtmltopdf package from following site
http://code.google.com/p/wkhtmltopdf/downloads/list
OR
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2(wkhtmltopdf-0.9.9-static-i386.tar.bz2 is a stable release for wkhtmltopdf )
Then extract using command
tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2Then move extracted DIR to usr/local/bin folder
sudo mv wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdfCheck wkhtmltopdf is install or not using following command
which wkhtmltopdf wkhtmltopdf –help
Installing wkhtmltopdf on MacOs
brew install Caskroom/cask/wkhtmltopdf
回答2:
Another way to use official binaries within Rails is adding the following line to your Gemfile:
gem 'wkhtmltopdf-installer'
This way the official binaries from http://wkhtmltopdf.org will be downloaded and added to your bundle during bundle install phase.
回答3:
I encountered this problem this morning.
Before you do anything, please check out: https://github.com/pdfkit/pdfkit/wiki/Installing-WKHTMLTOPDF
Download a binary edition of wkhtmltopdf at http://code.google.com/p/wkhtmltopdf/downloads/list
Decompress the package.
Copy the file like
wkhtmltopdf-i386to/usr/local/bin/&/opt/(also you could make soft link).That's done.
Good luck.
来源:https://stackoverflow.com/questions/10860431/how-to-install-wkhtmltopdf