Skip to content

PhantomJS on El Capitan

Todd Tyree edited this page Dec 2, 2015 · 9 revisions

01-Dec-2015

The current PhantomJS homebrew package will not install on OSX 10.11.X (El Capitan). It complains that it only supports version up to Yosemite.

For the application, proper, this is worked around using the phantomjs gem:

gem 'phantomjs', require: 'phantomjs/poltergeist'

However, the smoke tests do not run under bundler, and so will fail with capybara complaining that it cannot find phantomjs in the path. The current prebuilt version in the zipfile downloadable from phantomjs.org is built for 10.0.7 (Lion) and also will not run on El Captian.

The two workarounds are to install 1.9.8 using node:

npm install phantom phantomjs -g

Or, if you want version 2.0, build from source:

http://phantomjs.org/build.html

This is painful, however, as the build instructions are slightly wrong (you cannot checkout branch 2.0.0 without having a conflict with the qt submodule). And build.sh issues this warning when you run it:

---------------------------------------
               WARNING
----------------------------------------

Building PhantomJS from source takes a very long time, anywhere from 30
minutes to several hours (depending on the machine configuration).
We recommend you use the premade binary packages on supported operating
systems.

The smoke tests run fine with version 1.9.8, so I recommend that as the easiest way to get it working on an El Capitan machine.

Clone this wiki locally