Running phantomjs from a Ruby on Rails application

I am interested in using Phantomjs and I would like to run it from my Ruby on Rails application. However, this is a command line tool (i.e. I need to run something like phantomjs rasterize.js http://raphaeljs.com/polar-clock.html clock.png in my terminal). How do I execute a command line tool from my application?

+7
source share
1 answer

Use backlinks in your ruby ​​code, for example:

 output = `phantomjs rasterize.js http://raphaeljs.com/polar-clock.html clock.png` 
+8
source

All Articles