LoginSignup
27
25

More than 5 years have passed since last update.

El Capitan にPhantomJS 2.0をインストールする

Last updated at Posted at 2015-11-15

Mac OS X El Capitan にhomebrewでPhantomJSをインストールができないので、マニュアルでインストールしようとしたところ、一手間必要だったので、そのメモ。

Homebrewでインストールできない。

2015年11月15日現在、Homebrew でphantomjsをインストールしようとすると、

$ brew install phantomjs
phantomjs: This formula either does not compile or function as expected on OS X
versions newer than Yosemite due to an upstream incompatibility.
Error: An unsatisfied requirement failed this build.

ということで、まだEl Capitan向けのFormulaが配布されていないようです。

公式からバイナリを落とす

PhantomJS で配布しているMac OS X向けPhantomJSのバイナリがあるので、それをダウンロード、展開して、bin/phantomjs を実行可能な場所に移します。

ですが、この時点で実行すると、

$ phantomjs
zsh: killed     phantomjs

のように即死してしまいます。

Github上のPhantomJSのリポジトリに、これに関するIssueが上がっていて、それによると upx を利用して、実行環境に合わせてバイナリをパッケージング(?)し直すといいようです。

$ brew install upx 
$ upx -d /path/to/bin/phantomjs

upx…まだよくわかってないですが、デキる子や。。。

参考

27
25
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
27
25