Capybara-webkit and Qt5 on Yosemite
Asked Answered
O

2

11

Latest Capybara-webkit throws a deprecation warning:

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

So I:

gem uninstall capybara-webkit
brew uninstall qt
brew install qt5
gem install capybara-webkit

That deprecation is now gone but all hell broke loose:

$ rspec -p -- spec/features

Randomized with seed 52457
...2015-07-30 16:56:21.731 webkit_server[8416:6381638] Error loading /Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin:  dlopen(/Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin, 265): no suitable image found.  Did find:
    /Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin: mach-o, but wrong architecture
plugin,NP_Initialize start
plugin,NP_Initialize end
plugin,NP_GetEntryPoints start
Private_Initialize
plugin,NP_GetEntryPoints end
2015-07-30 16:56:21.768 webkit_server[8416:6381638] Error loading /Users/meltemi/Library/Internet Plug-Ins/Google Earth Web Plug-in.plugin/Contents/MacOS/libnpgeplugin.dylib:  dlopen(/Users/meltemi/Library/Internet Plug-Ins/Google Earth Web Plug-in.plugin/Contents/MacOS/libnpgeplugin.dylib, 265): no suitable image found.  Did find:
    /Users/meltemi/Library/Internet Plug-Ins/Google Earth Web Plug-in.plugin/Contents/MacOS/libnpgeplugin.dylib: mach-o, but wrong architecture
[16:56:22.960] figHttpRequestDidReceiveResponseCallback signalled err=-12938 (kFigHTTPError_FileNotFound) (404 file not found) at /SourceCache/CoreMedia/CoreMedia-1562.235/Prototypes/FigHTTP/FigHTTPRequestCFURLConnection.c line 2037
[16:56:22.960] HTTPRequest figHttpRequestDidReceiveResponseCallback: received http response 404 (error -12938) for https://s3-us-west-2.amazonaws.com/myapp-test/assets/abc-audio.mp3
[16:56:22.960] HTTPRequest figHTTPDumpFinalURLAndRemoteAddress: address 123.231.123.21 final url https://s3-us-west-2.amazonaws.com/myapp-test/assets/abc-audio.mp3
[16:56:23.061] FigDCP_GetCacheFileVersion signalled err=-12540 (kFigDiskCacheProviderError_InvalidCacheFile) (unsupported file version) at /SourceCache/CoreMedia/CoreMedia-1562.235/Prototypes/FigByteStreamPrototypes/FigLimitedDiskCacheProvider.c line 366
[16:56:23.218] figHttpRequestDidReceiveResponseCallback signalled err=-12938 (kFigHTTPError_FileNotFound) (404 file not found) at /SourceCache/CoreMedia/CoreMedia-1562.235/Prototypes/FigHTTP/FigHTTPRequestCFURLConnection.c line 2037
[16:56:23.218] HTTPRequest figHttpRequestDidReceiveResponseCallback: received http response 404 (error -12938) for https://s3-us-west-2.amazonaws.com/myapp-test/assets/abc-audio.mp3
[16:56:23.218] HTTPRequest figHTTPDumpFinalURLAndRemoteAddress: address 123.231.123.21 final url https://s3-us-west-2.amazonaws.com/myapp-test/assets/abc-audio.mp3
F[16:56:27.056] figHttpRequestDidReceiveResponseCallback signalled err=-12938 (kFigHTTPError_FileNotFound) (404 file not found) at /SourceCache/CoreMedia/CoreMedia-1562.235/Prototypes/FigHTTP/FigHTTPRequestCFURLConnection.c line 2037
[16:56:27.056] HTTPRequest figHttpRequestDidReceiveResponseCallback: received http response 404 (error -12938) for https://s3-us-west-2.amazonaws.com/myapp-test/assets/abc-audio.mp4
[16:56:27.056] HTTPRequest figHTTPDumpFinalURLAndRemoteAddress: address 123.231.123.21 final url https://s3-us-west-2.amazonaws.com/myapp-test/assets/abc-audio.mp4
[16:56:27.209] figHttpRequestDidReceiveResponseCallback signalled err=-12938 (kFigHTTPError_FileNotFound) (404 file not found) at /SourceCache/CoreMedia/CoreMedia-1562.235/Prototypes/FigHTTP/FigHTTPRequestCFURLConnection.c line 2037
[16:56:27.209] HTTPRequest figHttpRequestDidReceiveResponseCallback: received http response 404 (error -12938) for https://s3-us-west-2.amazonaws.com/myapp-test/assets/abc-audio.webm
[16:56:27.209] HTTPRequest figHTTPDumpFinalURLAndRemoteAddress: address 123.231.123.21 final url https://s3-us-west-2.amazonaws.com/myapp-test/assets/abc-audio.webm
F.............[DEPRECATION] Capybara::Webkit::Driver#browser is deprecated.
.[DEPRECATION] Capybara::Webkit::Driver#browser is deprecated.

tried re-installing qt but there were linking conflicts with Qt5's qmake so I removed it.

Anyone have any ideas?!? Or should I just go back to plain old Qt4 and deal with deprecation warnings?

Outthink answered 31/7, 2015 at 0:23 Comment(2)
Are you using capybara-webkit for some specific reason? Otherwise i'd tell you to use github.com/teampoltergeist/poltergeist, it's faster than webkit and works like a charm with JS.Gamesmanship
capybara-webkit has worked fine for us…until this Qt5 issue…Outthink
W
17

@pthamm pretty much nailed it. Here's the same thing, but with a couple of the surrounding steps.

brew uninstall qt
brew install qt5
brew link --force qt5

Now running

which qmake

Should return /usr/local/bin/qmake

At this point I can rebuild the gem against the new qt5.

gem pristine capybara-webkit

And then I was good to go again, tests are green. Yay!

Wilma answered 30/10, 2015 at 2:12 Comment(2)
Please note that (as stated in the official capybara-webkit installation instructions here: github.com/thoughtbot/capybara-webkit/wiki/…) qt5 will not include QtWebKit starting at version 5.6 and therefore qt 5.5 is the last version supported by the gem. This means you should replace qt5 with qt55 for each of the above install/link commands.Remarkable
For me, the following worked on an Ubuntu system with no brew installed: sudo apt-get install qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x (as per instructions on thoughtbot/capybara-webkit) followed by gem pristine capybara-webkit (as per counterbeing's answer above).Dissidence
S
5

Did you run these commands:

brew linkapps qt5
brew link --force qt5

Homebrew's qt5 is keg-only so you need to create the symlinks manually.

check out the installation instructions for Yosemite here: https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit

and the top answer here: Can I use homebrew's qt5 with capybara-webkit?

Secondrate answered 5/8, 2015 at 15:9 Comment(1)
I succeeded in removing WARNINGS with brew unlink qt before link qt5 and reinstalling capybara-webkit.Naman

© 2022 - 2024 — McMap. All rights reserved.