Skip to content
jejacks0n edited this page Jan 11, 2013 · 10 revisions

This page is to help get PhantomJS running on Linux.

Due to the nature of gemspecs being evaluated at package time, and not on installation, phantomjs.rb doesn't properly add the phantomjs-linux dependency, so you'll have to include it manually in your Gemfile.

Gemfile

gem "phantomjs-linux" if RUBY_PLATFORM =~ /linux/

It's also been reported that since the bin file included with phantomjs-linux is compiled for 32bit versions you may have to sudo apt-get install ia32-libs if you're running in 64bit (check this issue).

Using your own

If you'd rather use a different installation of phantomjs, you can tell Teabag to do that by setting the phantomjs_bin configuration directive.

http://phantomjs.org/download.html

teabag_env.rb

Teabag.setup do |config|
  config.phantomjs_bin = "/path/to/phantomjs"
end

It's important to understand how this works across different platforms and you should add whatever logic you need around this.

If all else fails, you might want to consider Using Selenium WebDriver.