Skip to content


Subversion checkout URL

You can clone with
Download ZIP


freezes #110

cj opened this Issue · 24 comments
cj commented


So I'm using the current master head and have this code:

  def show
    respond_with claim do |format|
      format.pdf do
        render pdf: claim.number.gsub(/[^0-9a-z]/i, '_'), layout: 'print.html'

and once it gets to here:

"***************\"/usr/local/bin/wkhtmltopdf\" -q        - - ***************"

It just freezes. When I kill the server with ctrl + c it then renders the pdf.... any ideas on what's going wrong?

Many thanks

p.s. I'm using the latest home brew version /usr/local/Cellar/wkhtmltopdf/0.11.0_rc1

cj commented

So I found out something very strange, it's showing the wkhtmltopdf bin icon in the dock and when I click on it then it completes generating the pdf. I'm using mac osx 10.7.3....


I can verify the exact same behaviour with OS X 10.7.4.


I encounter this issue with OS X 10.7.4 and 0.10.0 rc2 (but strangely brew said I install 0.11.0_rc1, but the command line version is 0.10)

Only after you the process icon on the "dock" will it quickly render and exit.


+1 on 10.7.4 and /usr/local/Cellar/wkhtmltopdf/0.11.0_rc1/bin/wkhtmltopdf.


This issue isn't specific to wicked_pdf, I'm having the same problem with PDFKit. The problem didn't appear until I installed 0.11.0_rc1 via homebrew. I stumbled on this ticket while trying to track down whether or not this was an issue with the wkhtmltopdf binary that comes with homebrew.


I see this issue as well. which wkhtmltopdf shows /usr/local/bin/wkhtmltopdf which is a link to ../Cellar/wkhtmltopdf/0.11.0_rc1/bin/wkhtmltopdf. However, I see the 0.10 when I run wkhtmltopdf --version.



The problem comes from wkhtmltopdf. It has been reported at
I also used OSX 10.7.4 and wkhtmltopdf 0.11.rc1.

By waiting a solution, I moved back to 0.9.9 and it works.


Currently running OSX 10.7.4 and wkhtmltopdf 0.9.9 and this isn't working for me. wkhtmltopdf bin icon appears in my dock but clicking it or exiting it does nothing and Firefox just outputs a "Connection was reset" error after approx 10 seconds.


Same problem.
OSX 10.7.4, wkhtmltopdf 0.10.0 rc2 (installed by homebrew).


I got this working in the end. Rolling back to version 0.9.9 fixed the problem for me.

I also had to be careful as i was using Unicorn with a process timeout of 30s. I had some PDF's (before optimisation) which were taking longer than 30s to generate so i was getting timeout errors, as you'd expect.

If you're not sure about how to rollback to an older package version using Homebrew, i did a writeup here: Homebrew and installing old package versions.


Same problem here. Tried so many different options. Such a simple task, so many problems with dependencies and native extensions..


I'm on OS 10.6.8, same issue. Solved by rolling back wkhtmltopdf to 0.9.9. Now the wkhtmltopdf shell just pops up and disappears, leaving a beautiful pdf in the browser. Here's full steps, for newbs:

Step 1: uninstall wkhtmltopdf
$ brew uninstall wkhtmltopdf
Uninstalling /usr/local/Cellar/wkhtmltopdf/0.11.0_rc1...

Step 2: find version 0.9.9
$ brew versions wkhtmltopdf
0.11.0_rc1 git checkout aa80fbc /usr/local/Library/Formula/wkhtmltopdf.rb
0.9.9 git checkout 6e2d550 /usr/local/Library/Formula/wkhtmltopdf.rb

Step 3: Copy and paste the git checkout command (everything from git over to the right):
$ git checkout 6e2d550 /usr/local/Library/Formula/wkhtmltopdf.rb

Step 4: reinstall
$ brew install wkhtmltopdf

The last output line should say something like
/usr/local/Cellar/wkhtmltopdf/0.9.9: 6 files, 424K, built in 15 seconds


Before step 3 you have to cd to /usr/local/Library/Formula/ otherwise you will get a fatal: '/usr/local/Library/Formula/wkhtmltopdf.rb' is outside repository error.


Same problem here: OSX 10.7.5 and newest wkhtmltopdf from homebrew. The solution to roll back to 0.9.9 works fine for me.


I've just migrated to 10.8.3 and now, wkhtmltopdf is showing up in the Dock when converting PDF... is there a way to stop this Dock 'appearance'?


If it goes away once the PDF is rendered, don't worry about it. It's just showing that the script is running on your machine. It won't happen in production.


installing 0.9.9 worked for me,

is it possible that it's been two major releases since the last working version?

is this issue happening only to MAC users?


As far as I've ever heard, this only affects OSX builds of wkhtmtopdf binaries. Most production systems run Linux or Windows, that do not suffer this strange behavior, and it is one of the reasons I have recommended in the past for people to stick with 0.9.6. I plan to investigate more this weekend, as that is quite old now, and a few major releases behind.


For information, this seems to be fixed with last binary package from here
I just installed 0.12.1 (carbon edition) and it worked


Well not so bright: I still have some PDF not working. Apparently it hangs for larger files like this : with big CSS data
But using command line on this file work well.


wkhtmltopdf with wicked_pdf 0.9.9 or 0.11.0 on OS X 10.10.1 got same problem.

See my next comment.


For people who use Puma. You need at least 2 process worker. With only 1 worker it will freeze. Change to 2 workers worked for me. The number of process workers can be set in config/puma.rb.


@JuanitoFatas I hang when using 'rails s' to serve my app on Mac. Any idea if this is related / is there a way to increase # of workers using the default rails s?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.