从Ruby on Rails应用程序运行phantomjs

我对使用Phantomjs很感兴趣,我想从我的Ruby on Rails应用程序中运行它。 但是,这是一个命令行工具(即我需要在我的终端中运行像phantomjs rasterize.js http://raphaeljs.com/polar-clock.html clock.png这样的东西)。 我如何从我的应用程序执行命令行工具?

在ruby代码中使用反引号,例如:

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