<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>panxiubin (panxiubin)</title>
    <link>https://ruby-china.org/panxiubin</link>
    <description>全栈工程师 + 二次元患者</description>
    <language>en-us</language>
    <item>
      <title>如何安装 phantomjs 2.0.0 版本 ？求助</title>
      <description>&lt;p&gt;我用的 mac 系统是：10.12.1 macOS Sierra
现在 phantomjs 版本已经更新到了 2.1.1，但由于之前他们做项目的时候用的是 2.0.0 版本，于是我需要在电脑上安装 2.0.0 版本的 phantomjs。
我尝试过的几个方式：&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;直接用 brew 来安装 brew install phantomjs（这时候下载的是最新版 2.1.1 的不能用，在系统中会出现报错）&lt;/li&gt;
&lt;li&gt;&lt;p&gt;在 &lt;a href="https://bitbucket.org/ariya/phantomjs/downloads" rel="nofollow" target="_blank" title=""&gt;phantomjs-2.0.0-macosx.zip&lt;/a&gt; 下载，也不能用，输入 phantomjs -v 确认版本的时候出现
[1]    48674 killed     phantomjs -v&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;看到这个“&lt;a href="http://www.cnblogs.com/weiok/p/4866473.html" rel="nofollow" target="_blank" title=""&gt;官网提供的 2.0.0 版本在 mac 10.0 中会报 phantomjs killed:9 错误&lt;/a&gt;，解决办法下载补丁版本
&lt;a href="https://github.com/eugene1g/phantomjs/releases/download/2.0.0-bin/phantomjs-2.0.0-macosx.zip" rel="nofollow" target="_blank"&gt;https://github.com/eugene1g/phantomjs/releases/download/2.0.0-bin/phantomjs-2.0.0-macosx.zip&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;running phantomjs on osx yosemite, download the build/fix found at:

https://github.com/eugene1g/phantomjs/releases

original issue:

https://github.com/ariya/phantomjs/issues/12928
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;于是下载补丁版本，依然出现如上的错误。我出现的不是 killed：9，而是 48674 killed。&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;于是决定下载源代码在电脑上进行编译。源代码地址是这个 &lt;a href="https://npm.taobao.org/mirrors/phantomjs" rel="nofollow" target="_blank" title=""&gt;phantomjs-2.0.0-source.zip &lt;/a&gt; 
&lt;code&gt;
1 cd /usr/local/bin
2 axel https://npm.taobao.org/mirrors/phantomjs/phantomjs-2.0.0-source.zip    #下载源码
3 unzip phantomjs-2.0.0-source.zip    #解压源码
4 cd phantomjs-2.0.0
5 ./build.sh  #开始编译
&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;但是在开始编译的时候出现了 bug，“Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild without arguments”&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2016/0b16f90164f561f1569dea54984735a9.png!large" title="" alt=""&gt;
看到这篇文章 &lt;a href="http://www.heapoverflow.me/question-qt-does-not-work-since-xcode-8-39544135" rel="nofollow" target="_blank" title=""&gt;Qt does not work since Xcode 8&lt;/a&gt;
于是修改了这里&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Replace:

isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2&amp;gt;/dev/null")))
With:

isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2&amp;gt;/dev/null")))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;再次运行，出现了 bug“clang: error: linker command failed with exit code 1 (use -v to see invocation)”
&lt;img src="https://l.ruby-china.com/photo/2016/78837b612fddbcff9b2dd438dbe46513.png!large" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;想请教一下大家，如何才能在系统 10.12.1 macOS Sierra 上安装 phantomjs2.0.0？谢谢！&lt;/p&gt;</description>
      <author>panxiubin</author>
      <pubDate>Tue, 22 Nov 2016 12:00:06 +0800</pubDate>
      <link>https://ruby-china.org/topics/31658</link>
      <guid>https://ruby-china.org/topics/31658</guid>
    </item>
  </channel>
</rss>
