在Rspec中使用外部库运行phantomjs

在Rspec中使用外部库运行phantomjs,rspec,phantomjs,poltergeist,Rspec,Phantomjs,Poltergeist,我正在尝试使用Poltergeist和Rspec在PhantomJS中运行一组特性规范。规范正常通过,但当我将jQuery切换到CDN时,它们失败了。有没有办法让PhantomJS加载外部JavaScript库 Failure/Error: visit root_path Capybara::Poltergeist::JavascriptError: One or more errors were raised in the Javascript code on the

我正在尝试使用Poltergeist和Rspec在PhantomJS中运行一组特性规范。规范正常通过,但当我将jQuery切换到CDN时,它们失败了。有没有办法让PhantomJS加载外部JavaScript库

Failure/Error: visit root_path
     Capybara::Poltergeist::JavascriptError:
       One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details).

       ReferenceError: Can't find variable: jQuery
       ReferenceError: Can't find variable: jQuery
           at http://127.0.0.1:60021/assets/application.js:446

我通过使用协议相关URL加载CDN库解决了这个问题。这允许我在生产中通过HTTPS加载库,但规范可以使用HTTP加载它们

<script src=""//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

是HTTPS上的CDN版本,您是否有低于1.9.8的PhantomJS版本?这些资产都是通过CDNJS的HTTPS提供的。但是,我运行的是PhantomJS1.9.7。我可以升级到1.9.8。在版本升级期间,是否对库进行了更改以修复此问题?有更改,但不是对PhantomJS,而是对(几乎)所有https服务器进行了更改:很高兴知道。我星期一回办公室时会试试这个。谢谢不幸的是,这似乎并没有解决问题。有没有国旗我也需要翻动?