0

Tried installing phantomjs via brew, receive this error

==> Downloading https://github.com/ariya/phantomjs/archive/2. Already downloaded: /Library/Caches/Homebrew/phantomjs-2.0.0.tar.gz ==> Downloading https://gist.githubusercontent.com/mikemcquaid/db645f7cbeec4f3b1b2e/raw/e664ecc5c259344d5a73a84b52e472bf8ad3733

curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "phantomjs--patch"
Download failed: https://gist.githubusercontent.com/mikemcquaid/db645f7cbeec4f3b1b2e/raw/e664ecc5c259344d5a73a84b52e472bf8ad3733e/phantomjs-yosemite.patch
mujuonly
  • 11,370
  • 5
  • 45
  • 75
cthomas
  • 27
  • 2
  • 7

1 Answers1

1

Installing PhantomJS on Ubuntu

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev

Install these packages needed by PhantomJS to work correctly.

sudo apt-get install libfreetype6 libfreetype6-dev
sudo apt-get install libfontconfig1 libfontconfig1-dev

Get it from the PhantomJS website.

cd ~
export PHANTOM_JS="phantomjs-1.9.8-linux-x86_64"
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2

Once downloaded, move Phantomjs folder to /usr/local/share/ and create a symlink:

sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin

Now, It should have PhantomJS properly on your system.

phantomjs --version

Anil Agrawal
  • 2,748
  • 1
  • 24
  • 31