title: How do I take screenshots of web pages using ruby and a unix server?
body: <p>I'm trying to programatically create thumbnail images of a large number of web pages that are hosted on my own ruby/rails-based website.</p>
  
  <p>I want to be able to code a stand-alone bit of ruby that looks something like this:</p>
  
  <pre><code>require 'awesome-screenshot-maker'
  
  items.each do |id|
    url = "http://foo.com/bar/#{id}"
    shooter = AwesomeScreenshotMaker.new(0.2) # thumbnails are 20% of original
    shooter.capture(url, "/images/thumbnail-#{id}.png")
  end
  </code></pre>
  
  <p>I need the awesome-screenshot-maker library (and its dependencies) to be fairly easy to build on Linux, Solaris and Mac OS X. Ideally it will install with a single 'gem install' command.</p>
  
  <p>I've spent the afternoon exploring various options, including <a href="http://www.lilik.it/~mirko/Ruby-GNOME2/moz-snapshooter.rb" rel="nofollow noreferrer">Moz snap shooter</a>, <a href="http://www.paulhammond.org/webkit2png/" rel="nofollow noreferrer">webkit2png</a> and <a href="http://github.com/danlucraft/rbwebkitgtk/tree/master" rel="nofollow noreferrer">rbwebkitgtk</a>. They are all in the right area, but none seem to work on all three platforms.</p>
  
  <p>RMagick looks like a possible option if I'm willing to output PDFs from my rails app (instead of web pages), but that strikes me as hacky. It's also very laborious to get RMagic and imagemagick up and running on Mac OS X.</p>
  
  <p>Does such a library exist that can easily be setup on three platforms?</p>