ruby-on-rails - 更新到 MacOS Sierra 时出现 Cliver 和 PhantomJS 错误

标签 ruby-on-rails macos rspec phantomjs

我从 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/

相关文章:

c++ - 在 OS X 上与 clang++ 链接会产生大量未找到符号的错误

python - 在 Snow Leopard 上为 Python 2.7 安装 MYSQL-python-1.2.3 时出现问题

ruby-on-rails - 如何阻止 phusion 乘客生成服务器重新启动?

ruby-on-rails - rails 路由和参数,其中包含 '.'

ruby-on-rails - rspec 分配将哈希键转换为字符串

ruby-on-rails - 使用 Action Cable 将 Ruby on Rails 应用程序部署到 Heroku(Puma 端口监听)

mysql - Rails 测试数据库比开发数据库快 10 倍

ruby-on-rails - Rails 服务器参数数量错误

SQL 查询 : how to select records, 但如果存在父记录,请选择它的最新子记录

ruby-on-rails - 如何在 Capybara finder 中使用正则表达式?