3

I'm using Ubuntu 14.04 and I need to get rspec and capybara working with QT5. I have installed QT5. but when I run rspec/feature/whatever_test get this warning:

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

However:

~ % 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

I have tried the qtchooser -qt=qt5 does not change anything. How can I switch to qt5, and have capybara use it?

thanks guys

ChrisCPO
  • 443
  • 2
  • 15

2 Answers2

4

So after installing qt5, you can verify by commands above. I had to uninstall capybara-webkit gem uninstall capybara-webkit. Upon reinstalling I got this mess:

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

key here was: Project ERROR: Unknown module(s) in QT: webkitwidgets

see this

What you need to do is run sudo apt-get install libqt5webkit5-dev then bundle install or gem install capybara-webkit.

Community
  • 1
  • 1
ChrisCPO
  • 443
  • 2
  • 15
2

Capybara doesn't use qt, the capybara-WebKit driver does. You need to uninstall and rebuild capybara-webkit

Thomas Walpole
  • 48,548
  • 5
  • 64
  • 78
  • Hey thanks for the response, any ideas how to do that. I just Uninstalled and now it's throwing all kinda of errors, when I try to reinstall. – ChrisCPO Oct 07 '15 at 17:32
  • hmmm -- https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit - actually states that it won't build with qt5 on 14.04 - not sure if that is current or out of date – Thomas Walpole Oct 07 '15 at 17:39
  • maybe this - https://bugs.launchpad.net/ubuntu/+source/qtwebkit-opensource-src/+bug/1134745 – Thomas Walpole Oct 07 '15 at 17:44