【发布时间】:2018-01-11 10:41:54
【问题描述】:
我有一个 Rails 5 应用程序,它在引导模式中包含多个表单。 Capybara 无法阅读模态内容。从阅读其他几篇堆栈溢出文章来看,我似乎需要安装 capybara-webkit gem。但是,我无法安装它。
在我的初始安装中,我收到一条错误消息:
Command 'qmake ' not available
extconf failed, exit code 1
Gem files will remain installed in
/Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/capybara-webkit-1.14.0 for inspection.
Results logged to
An error occurred while installing capybara-webkit (1.14.0), and Bundler cannot continue.
Make sure that `gem install capybara-webkit -v '1.14.0'` succeeds before bundling.
看了一圈,好像需要安装QT。所以我尝试使用本文中的说明进行安装:https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit
我在 OS X El Capitan 上,所以我跑了:
brew install qt@5.5
然后我按照说明在命令行中输入了这个(我相信。这可能是我搞砸的地方):
echo 'export PATH="$(brew --prefix qt@5.5)/bin:$PATH"' >> ~/.bashrc
我尝试再次安装 gem,但遇到了完全相同的问题:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/capybara-webkit-1.14.0
/Users/johnseabolt/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20170803-82842-1br8b1h.rb extconf.rb
*** 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=/Users/johnseabolt/.rbenv/versions/2.3.1/bin/$(RUBY_BASE_NAME)
--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 'qmake ' not available
extconf failed, exit code 1
Gem files will remain installed in
/Users/johnseabolt/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/capybara-webkit-1.14.0 for inspection.
Results logged to
An error occurred while installing capybara-webkit (1.14.0), and Bundler cannot continue.
Make sure that `gem install capybara-webkit -v '1.14.0'` succeeds before bundling.
我不能让它工作?救命!
【问题讨论】:
标签: ruby-on-rails macos qt rspec-rails capybara-webkit