I would like to suggest you the HTML to PDF solution by https://grabz.it.
They have a very flexible and simple-to-use screenshot API which can be used by any type of Ruby application.
If you want to try it, at first you should get the authorization app key + secret and the development free SDK
Then, in your app, the implementation steps would be:
//initialization
require 'grabzit'
grabzItClient = GrabzIt::Client.new("APPLICATION KEY", "APPLICATION SECRET")
//capturing the url to PDF
grabzItClient.url_to_pdf("http://www.google.com")
Next is the saving. You can use one of the two save methods, save if accessible callback handle available:
grabzItClient.save("http://www.example.com/handler/index")
And save_to if you need a synchronous save (which will force your application to wait while the screenshot is created):
filepath = "images/result.jpg"
grabzItClient.save_to(filepath)
Check the documentation for details about the saving.
That's all. It's possible to get other kinds of screenshots such as image screenshots as well.