ubuntu12.04(64bit)でpoltergeistを使う方法
前提条件:capybaraが使える状態(参考)
まずphantomjsをインストールします。(参考ページ)
cd /usr/local/share
sudo wget https://phantomjs.googlecode.com/files/phantomjs-1.9.0-linux-x86_64.tar.bz2
sudo tar xjf phantomjs-1.9.0-linux-x86_64.tar.bz2
sudo ln -s /usr/local/share/phantomjs-1.9.0-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.0-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.0-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
phantomjs --version
でバージョンが表示されたらインストール完了です。
Gemfileに追記します。
gem 'poltergeist'
rubyコード例です。
require 'capybara/poltergeist'