El Capitan:无法安装capybara-webkit

时间:2017-06-19 09:20:40

标签: ruby-on-rails rubygems bundle bundler capybara-webkit

我无法bundle,因为安装capybara-webkit (1.11.1)时出错了。 所以我尝试了gem install capybara-webkit -v '1.11.1',但它返回了错误:Failed to build gem native extension.我甚至不确定它是什么意思。

整个输出将是:

Building native extensions.  This could take a while...
ERROR:  Error installing capybara-webkit:
    ERROR: Failed to build gem native extension.

    current directory: ...

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=...
    --with-gl-dir
    --without-gl-dir
    --with-gl-include
    --without-gl-include=${gl-dir}/include
    --with-gl-lib
    --without-gl-lib=${gl-dir}/lib
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
Command ' ' not available

extconf failed, exit code 1

Gem files will remain installed in .../capybara-webkit-1.11.1 for inspection.
Results logged to .../capybara-webkit-1.11.1/gem_make.out

有谁知道如何处理这个问题? 提前谢谢!

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

@raghu发布的答案将与Qt5.5一起使用,这是capybara-webkit开发人员正式支持的最后一个版本。另一种选择是使用当前版本的qt制作自制软件安装qt-webkit,然后针对该版本构建capybara-webkit。如果您已经安装了qt,请从自制软件中卸载qt(brew uninstall qt),然后

brew install qt --with-qtwebkit

并且从源头开始编译并暂时执行其他操作。一旦完成,请再次尝试安装capybara-webkit gem。