Jus*_*zer 7 ruby command-line ruby-on-rails ruby-on-rails-3 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`
| 归档时间: | 
 | 
| 查看次数: | 7865 次 | 
| 最近记录: |