Ubuntu 14.04にPhantomJS 2.0をインストール
Ubuntu 14.04にPhantomJSをインストールする時の手順です。
動作環境
- Ubuntu 14.04
- PhantomJS 2.0
基本的には公式サイト(http://phantomjs.org/)の手順にのっとるだけ。
リポジトリのクローン
$ git clone git://github.com/ariya/phantomjs.git
ソースコードのコンパイル
$ cd phantomjs
$ git checkout 2.0
$ ./build.sh
build.sh
はデフォルトで並列処理をしてくれるみたいなのですが、それでも10分くらいかかりました。
実行ファイルのコピー
$ sudo cp bin/phantomjs /usr/local/bin/
以上でインストールは完了です。
起動
あとはターミナルからでも、スクリプトからでも使えます。
$ phantomjs phantomjs> 1 + 1; 2
参考URL