thoughtbot / capybara-webkit

A Capybara driver for headless WebKit to test JavaScript web apps
https://thoughtbot.com/open-source
MIT License
1.97k stars 427 forks source link

Qt on Homebrew no longer includes QtWebkit #1053

Closed mathias closed 6 years ago

mathias commented 6 years ago

These instructions don't talk about how to get QtWebkit: https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit#homebrew

I think this is the cause of #1052 -- I'm seeing that issue on bundle, but when I started investigating, I found that my new laptop does not have QtWebkit anywhere after brew install qt@5.5 per the above link.

Is there a known solution to this?

mathias commented 6 years ago

Some additional information for diagnosing: I have export PATH="$(brew --prefix qt@5.5)/bin:$PATH" in my .bashrc files. gem install capybara-webkit fails for 1.14.0 on Ruby 2.3.6. And brew info qt@5.5 shows it installed.

etagwerker commented 6 years ago

@mathias What does which qmake output?

One thing I've noticed is that adding export PATH="$(brew --prefix qt@5.5)/bin:$PATH" to your .bashrc is not enough. You need to run source .bashrc or open a new terminal (for it to load it automatically)

mathias commented 6 years ago

Yep; it has already been in there according to my dotfiles git history, since before I received this work laptop. I only ran into this issue when I tried to upgrade Ruby version in projects locally and our gem cache in /vendor not longer had the gem. The path in my terminals all start with:

$ echo $PATH
/usr/local/opt/qt@5.5/bin:/Users/mgauger/.rbenv/shims:...etc
mathias commented 6 years ago
$ which qmake
/usr/local/opt/qt@5.5/bin/qmake
mathias commented 6 years ago

Except when trying to bundle / gem install looks like

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

    current directory: /Users/mgauger/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/capybara-webkit-1.14.0
/Users/mgauger/.rbenv/versions/2.3.6/bin/ruby -r ./siteconf20180116-91066-w41knz.rb extconf.rb
Info: creating stash file /Users/mgauger/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/capybara-webkit-1.14.0/.qmake.stash
cd src/ && ( test -e Makefile.webkit_server || /Users/mgauger/anaconda3/bin/qmake
/Users/mgauger/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/capybara-webkit-1.14.0/src/webkit_server.pro -o Makefile.webkit_server ) &&
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.webkit_server
Project ERROR: No QtWebKit installation found. QtWebKit is no longer included with Qt 5.6, so you may need to install it separately.
make: *** [sub-src-webkit_server-pro-make_first-ordered] Error 3
Command 'make ' failed

-- I see /Users/mgauger/anaconda3/bin/qmake in there too -- I'm beginning to suspect the Anaconda Python distribution as confusing the compiler.

mathias commented 6 years ago

That must be it:

$ qmake --version
QMake version 3.0
Using Qt version 5.6.2 in /Users/mgauger/anaconda3/lib
$ /usr/local/opt/qt@5.5/bin/qmake --version
QMake version 3.0
Using Qt version 5.5.1 in /usr/local/Cellar/qt@5.5/5.5.1_1/lib
miguelaorz2018 commented 6 years ago

Mathias did you solve the problem?

mathias commented 6 years ago

Yes, it seems like I had to make sure I wasn't using the QMake from Anaconda (A Python data science package manager / version manager.)

syedrakib commented 5 years ago

I am still getting the Project ERROR: No QtWebKit installation found. QtWebKit is no longer included with Qt 5.6, so you may need to install it separately. error when i try to do bundle install even though qmake is in its path all well

➜ $ brew install qt

➜ $ echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.zshrc

➜ $ source ~/.zshrc

➜ $ qmake --version
QMake version 3.1
Using Qt version 5.12.0 in /usr/local/Cellar/qt/5.12.0/lib

➜ $ which qmake
/usr/local/opt/qt/bin/qmake

➜  $ /usr/local/opt/qt/bin/qmake --version
QMake version 3.1
Using Qt version 5.12.0 in /usr/local/Cellar/qt/5.12.0/lib
zsemenenko commented 5 years ago

had the same issue, found description in "webkit_server.pro" file :

qtHaveModule(webkitwidgets) {
    QT += webkitwidgets
   } else {
      error("No QtWebKit installation found. QtWebKit is no longer included with Qt 5.6, so you may need to install it separately.")
   }

so, I needed to install "webkitwidgets", for debian it was found in package "libqt5webkit5-dev" and it solved my problem