rspec和capybara有关于使用4.8.2的QT警告但是安装了qt5

时间:2015-10-07 17:02:08

标签: qt ubuntu rspec capybara capybara-webkit

我使用的是Ubuntu 14.04,我需要让rspec和capybara使用QT5。我已经安装了QT5。但是当我运行rspec / feature / whatever_test时会收到此警告:

WARNING: The next major version of capybara-webkit will require at least version 5.0 of Qt. You're using version 4.8.6.

然而:

~ % TDIR=/usr/share/qtX qmake --version
QMake version 3.0
Using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu

~ % qtchooser -l
4
5
default
qt4-i386-linux-gnu
qt4-x86_64-linux-gnu
qt4
qt5-x86_64-linux-gnu
qt5

我试过qtchooser -qt=qt5并没有改变任何东西。 如何切换到qt5,让capybara使用它?

谢谢你们

1 个答案:

答案 0 :(得分:4)

因此在安装qt5之后,您可以通过上面的命令进行验证。我不得不卸载capybara-webkit gem uninstall capybara-webkit。重新安装后,我得到了这个烂摊子:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /home/chris/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20151007-20641-1jdvtt5.rb extconf.rb
cd src/ && ( test -e Makefile.webkit_server || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /home/chris/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/capybara-webkit-1.6.0/src/webkit_server.pro -o Makefile.webkit_server ) && make -f Makefile.webkit_server 
Project ERROR: Unknown module(s) in QT: webkitwidgets
make: *** [sub-src-webkit_server-pro-make_first-ordered] Error 3
Command 'make' failed

make "DESTDIR=" clean
cd src/ && ( test -e Makefile.webkit_server || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /home/chris/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/capybara-webkit-1.6.0/src/webkit_server.pro -o Makefile.webkit_server ) && make -f Makefile.webkit_server clean
Project ERROR: Unknown module(s) in QT: webkitwidgets
make: *** [sub-src-webkit_server-pro-clean-ordered] Error 3

make "DESTDIR="
cd src/ && ( test -e Makefile.webkit_server || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /home/chris/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/capybara-webkit-1.6.0/src/webkit_server.pro -o Makefile.webkit_server ) && make -f Makefile.webkit_server 
Project ERROR: Unknown module(s) in QT: webkitwidgets
make: *** [sub-src-webkit_server-pro-make_first-ordered] Error 3
这里的关键是:项目错误:QT中的未知模块:webkitwidgets

请参阅this

您需要做的是运行sudo apt-get install libqt5webkit5-dev然后捆绑安装或gem install capybara-webkit。