我从 OSX El Capitan 更新到 MacOS Sierra 并开始看到 PhantomJS 错误。$ rspec <some feature test
... The detector #<struct Cliver::Detector command_arg=nil, version_pattern=nil> failed to detect theversion of the executable at '/app/node_modules/phantomjs-prebuilt/bin/phantomjs'
我该如何解决这个问题?
最佳答案
玩了一段时间后,我意识到 $ phantomjs --version
没有返回任何东西。奇怪的。我也检查了两者
$ brew list
$ npm ls
并看到两者都没有将 phantomjs 列为他们的软件包之一。看起来我的 phantomjs 安装有问题。我决定重新安装 phantomjs。
我首先确定 phantomjs 的安装位置:
$ which phantomjs
/usr/local/bin/phantomjs
去掉它:
$ rm -rf /usr/local/bin/phantomjs
$ phantomjs -v
-bash: /usr/local/bin/phantomjs: No such file or directory
好的。现在使用 npm 安装 phantomjs:
$ npm -g install phantomjs-prebuilt
$ phantomjs -v
2.1.1
这看起来很有希望。让我们再次运行我们的规范:
$ rspec <some feature test>
1 example, 0 failures
成功。
关于ruby-on-rails - 更新到 MacOS Sierra 时出现 Cliver 和 PhantomJS 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40528895/