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

Capybara-webkit +qt5.5 fails with X Code 10 #1072

Closed ColinTheRobot closed 5 years ago

ColinTheRobot commented 6 years ago

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
    current directory: /Users/.../.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-webkit-1.14.0
/Users/.../.rbenv/versions/2.4.4/bin/ruby -r ./siteconf20180918-3930-97t0qf.rb extconf.rb
Info: creating stash file /Users/.../.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-webkit-1.14.0/.qmake.stash
cd src/ && ( test -e Makefile.webkit_server || /usr/local/bin/qmake
/Users/.../.rbenv/versions/2.4.4/lib/ruby/gems/2.4.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
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -pipe -O2 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.7 -Wall -W
-fPIC -DQT_NO_DEBUG -DQT_WEBKITWIDGETS_LIB -DQT_WIDGETS_LIB -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I.
-I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWebKitWidgets.framework/Headers
-I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWebKit.framework/Headers
-I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtNetwork.framework/Headers
-I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtCore.framework/Headers -Ibuild
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Headers
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AGL.framework/Headers
-I/usr/local/Cellar/qt@5.5/5.5.1_1/mkspecs/macx-clang -F/usr/local/Cellar/qt@5.5/5.5.1_1/lib -x c++-header -c stable.h -o
build/webkit_server/c++.pch
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library
instead [-Wstdlibcxx-not-found]
In file included from stable.h:1:
In file included from /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWidgets.framework/Headers/QApplication:1:
In file included from /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWidgets.framework/Headers/qapplication.h:37:
In file included from /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtCore.framework/Headers/qcoreapplication.h:37:
/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtCore.framework/Headers/qglobal.h:39:12: fatal error: 'cstddef' file not found
#  include <cstddef>
           ^~~~~~~~~
1 warning and 1 error generated.
make[1]: *** [build/webkit_server/c++.pch] Error 1
make: *** [sub-src-webkit_server-pro-make_first-ordered] Error 2
Command 'make ' failed
current directory: /Users/.../.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-webkit-1.14.0
make "DESTDIR=" clean
cd src/ && ( test -e Makefile.webkit_server || /usr/local/bin/qmake
/Users/.../.rbenv/versions/2.4.4/lib/ruby/gems/2.4.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 clean
rm -f qrc_webkit_server.cpp
rm -f build/moc_BlockUrl.cpp build/moc_AllowUrl.cpp build/moc_SetUnknownUrlMode.cpp build/moc_FindModal.cpp build/moc_AcceptAlert.cpp
build/moc_GoForward.cpp build/moc_GoBack.cpp build/moc_WindowMaximize.cpp build/moc_WindowSize.cpp build/moc_WindowCommand.cpp
build/moc_WindowOpen.cpp build/moc_WindowClose.cpp build/moc_Version.cpp build/moc_EnableLogging.cpp build/moc_Authenticate.cpp
build/moc_SetConfirmAction.cpp build/moc_SetPromptAction.cpp build/moc_SetPromptText.cpp build/moc_ClearPromptText.cpp
build/moc_JavascriptAlertMessages.cpp build/moc_JavascriptConfirmMessages.cpp build/moc_JavascriptPromptMessages.cpp
build/moc_IgnoreSslErrors.cpp build/moc_WindowResize.cpp build/moc_CurrentUrl.cpp build/moc_ConsoleMessages.cpp build/moc_WebPage.cpp
build/moc_Server.cpp build/moc_Connection.cpp build/moc_Command.cpp build/moc_SocketCommand.cpp build/moc_Visit.cpp build/moc_Reset.cpp
build/moc_Node.cpp build/moc_JavascriptInvocation.cpp build/moc_Evaluate.cpp build/moc_Execute.cpp build/moc_FrameFocus.cpp
build/moc_Response.cpp build/moc_NetworkAccessManager.cpp build/moc_NetworkCookieJar.cpp build/moc_Header.cpp build/moc_Render.cpp
build/moc_Body.cpp build/moc_Status.cpp build/moc_Headers.cpp build/moc_UnsupportedContentHandler.cpp build/moc_SetCookie.cpp
build/moc_ClearCookies.cpp build/moc_GetCookies.cpp build/moc_CommandParser.cpp build/moc_CommandFactory.cpp build/moc_SetProxy.cpp
build/moc_NullCommand.cpp build/moc_PageLoadingCommand.cpp build/moc_SetSkipImageLoading.cpp build/moc_WebPageManager.cpp
build/moc_WindowFocus.cpp build/moc_GetWindowHandles.cpp build/moc_GetWindowHandle.cpp build/moc_GetTimeout.cpp
build/moc_SetTimeout.cpp build/moc_TimeoutCommand.cpp build/moc_SetUrlBlacklist.cpp build/moc_NoOpReply.cpp
build/moc_JsonSerializer.cpp build/moc_ErrorMessage.cpp build/moc_Title.cpp build/moc_FindCss.cpp build/moc_JavascriptCommand.cpp
build/moc_FindXpath.cpp build/moc_NetworkReplyProxy.cpp build/moc_StdinNotifier.cpp build/moc_RequestHandler.cpp
rm -f build/BlockUrl.o build/AllowUrl.o build/SetUnknownUrlMode.o build/FindModal.o build/AcceptAlert.o build/GoForward.o
build/GoBack.o build/WindowMaximize.o build/WindowSize.o build/WindowCommand.o build/WindowOpen.o build/WindowClose.o build/Version.o
build/EnableLogging.o build/Authenticate.o build/SetConfirmAction.o build/SetPromptAction.o build/SetPromptText.o
build/ClearPromptText.o build/JavascriptAlertMessages.o build/JavascriptConfirmMessages.o build/JavascriptPromptMessages.o
build/IgnoreSslErrors.o build/WindowResize.o build/CurrentUrl.o build/ConsoleMessages.o build/main.o build/WebPage.o build/Server.o
build/Connection.o build/Command.o build/SocketCommand.o build/Visit.o build/Reset.o build/Node.o build/JavascriptInvocation.o
build/Evaluate.o build/Execute.o build/FrameFocus.o build/Response.o build/NetworkAccessManager.o build/NetworkCookieJar.o
build/Header.o build/Render.o build/body.o build/Status.o build/Headers.o build/UnsupportedContentHandler.o build/SetCookie.o
build/ClearCookies.o build/GetCookies.o build/CommandParser.o build/CommandFactory.o build/SetProxy.o build/NullCommand.o
build/PageLoadingCommand.o build/SetTimeout.o build/GetTimeout.o build/SetSkipImageLoading.o build/WebPageManager.o build/WindowFocus.o
build/GetWindowHandles.o build/GetWindowHandle.o build/TimeoutCommand.o build/SetUrlBlacklist.o build/NoOpReply.o
build/JsonSerializer.o build/InvocationResult.o build/ErrorMessage.o build/Title.o build/FindCss.o build/JavascriptCommand.o
build/FindXpath.o build/NetworkReplyProxy.o build/IgnoreDebugOutput.o build/StdinNotifier.o build/RequestHandler.o
build/BlacklistedRequestHandler.o build/MissingContentHeaderRequestHandler.o build/CustomHeadersRequestHandler.o
build/NetworkRequestFactory.o build/UnknownUrlHandler.o build/qrc_webkit_server.o build/moc_BlockUrl.o build/moc_AllowUrl.o
build/moc_SetUnknownUrlMode.o build/moc_FindModal.o build/moc_AcceptAlert.o build/moc_GoForward.o build/moc_GoBack.o
build/moc_WindowMaximize.o build/moc_WindowSize.o build/moc_WindowCommand.o build/moc_WindowOpen.o build/moc_WindowClose.o
build/moc_Version.o build/moc_EnableLogging.o build/moc_Authenticate.o build/moc_SetConfirmAction.o build/moc_SetPromptAction.o
build/moc_SetPromptText.o build/moc_ClearPromptText.o build/moc_JavascriptAlertMessages.o build/moc_JavascriptConfirmMessages.o
build/moc_JavascriptPromptMessages.o build/moc_IgnoreSslErrors.o build/moc_WindowResize.o build/moc_CurrentUrl.o
build/moc_ConsoleMessages.o build/moc_WebPage.o build/moc_Server.o build/moc_Connection.o build/moc_Command.o build/moc_SocketCommand.o
build/moc_Visit.o build/moc_Reset.o build/moc_Node.o build/moc_JavascriptInvocation.o build/moc_Evaluate.o build/moc_Execute.o
build/moc_FrameFocus.o build/moc_Response.o build/moc_NetworkAccessManager.o build/moc_NetworkCookieJar.o build/moc_Header.o
build/moc_Render.o build/moc_Body.o build/moc_Status.o build/moc_Headers.o build/moc_UnsupportedContentHandler.o build/moc_SetCookie.o
build/moc_ClearCookies.o build/moc_GetCookies.o build/moc_CommandParser.o build/moc_CommandFactory.o build/moc_SetProxy.o
build/moc_NullCommand.o build/moc_PageLoadingCommand.o build/moc_SetSkipImageLoading.o build/moc_WebPageManager.o
build/moc_WindowFocus.o build/moc_GetWindowHandles.o build/moc_GetWindowHandle.o build/moc_GetTimeout.o build/moc_SetTimeout.o
build/moc_TimeoutCommand.o build/moc_SetUrlBlacklist.o build/moc_NoOpReply.o build/moc_JsonSerializer.o build/moc_ErrorMessage.o
build/moc_Title.o build/moc_FindCss.o build/moc_JavascriptCommand.o build/moc_FindXpath.o build/moc_NetworkReplyProxy.o
build/moc_StdinNotifier.o build/moc_RequestHandler.o
rm -f build/webkit_server/c.pch build/webkit_server/c++.pch build/webkit_server/objective-c.pch build/webkit_server/objective-c++.pch
rm -f *~ core *.core
current directory: /Users/.../.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-webkit-1.14.0
make "DESTDIR="
cd src/ && ( test -e Makefile.webkit_server || /usr/local/bin/qmake
/Users/.../.rbenv/versions/2.4.4/lib/ruby/gems/2.4.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
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -pipe -O2 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.7 -Wall -W
-fPIC -DQT_NO_DEBUG -DQT_WEBKITWIDGETS_LIB -DQT_WIDGETS_LIB -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I.
-I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWebKitWidgets.framework/Headers
-I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWebKit.framework/Headers
-I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtNetwork.framework/Headers
-I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtCore.framework/Headers -Ibuild
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Headers
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AGL.framework/Headers
-I/usr/local/Cellar/qt@5.5/5.5.1_1/mkspecs/macx-clang -F/usr/local/Cellar/qt@5.5/5.5.1_1/lib -x c++-header -c stable.h -o
build/webkit_server/c++.pch
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library
instead [-Wstdlibcxx-not-found]
In file included from stable.h:1:
In file included from /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWidgets.framework/Headers/QApplication:1:
In file included from /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWidgets.framework/Headers/qapplication.h:37:
In file included from /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtCore.framework/Headers/qcoreapplication.h:37:
/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtCore.framework/Headers/qglobal.h:39:12: fatal error: 'cstddef' file not found
#  include <cstddef>
           ^~~~~~~~~
1 warning and 1 error generated.
make[1]: *** [build/webkit_server/c++.pch] Error 1
make: *** [sub-src-webkit_server-pro-make_first-ordered] Error 2
make failed, exit code 2
Gem files will remain installed in /Users/.../.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-webkit-1.14.0 for
inspection.
Results logged to
/Users/.../.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-17/2.4.0-static/capybara-webkit-1.14.0/gem_make.out
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.
In Gemfile:
  capybara-webkit```

Just wanted to flag this with a descriptive title. 

The solution is to downgrade to X Code 9.4 for now
mjankowski commented 6 years ago

FYI it looks like qt@5.5 is being dropped from homebrew on account of no planned mojave support.

ColinTheRobot commented 6 years ago

Thanks for the heads up @mjankowski 👍 👍

chrisortman commented 6 years ago

Does #1073 make it so that capybara-webkit can be installed if you already have qtwebkit on your system only? I'm trying to figure out if I still need to get qt@5.5 to install via homebrew or not?

ColinTheRobot commented 6 years ago

@chrisortman you still need qt@5.5

1073 just resolves an issue where qt fails with xcode 10

chrisortman commented 6 years ago

Have any of you been able to install qt@5.5 on mojave yet? I get an error very similar to this complaining about cstddef so I'm hoping the fix will be something similar but I have no idea where to make the change

ColinTheRobot commented 6 years ago

I'm not on mojave yet, but per @mjankowski's comment above it looks like qt@5.5 doesn't and won't work on mojave

chrisortman commented 6 years ago

I don't think that that's a change on the qt side, qt stopped maintaining 55 a while ago, I think that's the homebrew maintainers saying they shouldn't maintain it anymore because it doesn't fit the requirements for what goes into homebrew core

ColinTheRobot commented 6 years ago

gotcha.

But yeah, don't really have an answer since I'm not on mojave. Sorry!

memoht commented 6 years ago

I tried to install qt@5.5 using Homebrew after a clean install of MacOS Mojave and it failed. Today, I thought I would try again. Ended up with the following

Error: No available formula with the name "qt@5.5" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

qt@5.5 was deleted from homebrew/core in commit 3609232:
  qt@5.5: delete

So, now what?

rickyc commented 6 years ago

You can probably follow these instructions and restore the formula locally.

Make sure you also have Xcode 9.4 installed, otherwise it won't build properly. You can get it from the Apple developer website.

memoht commented 6 years ago

@rickyc Thanks for the tip. It may be time to pour one out for capybara-webkit. Having Xcode 10 and 9.4 installed at the same time is a different set of headaches.

rickyc commented 6 years ago

So my colleagues have been setting up new computers. You can just install 9.4 first, then install Xcode 10 over it once qt5.5 has been installed. Since the package is already built, the dependency wouldn't matter anymore.

chrisortman commented 6 years ago

Would it be possible to install qt 5.5 using an older homebrew supplied gcc ?

phogel commented 6 years ago

I tried to install qt@5.5 using Homebrew after a clean install of MacOS Mojave and it failed. Today, I thought I would try again. Ended up with the following

Error: No available formula with the name "qt@5.5" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

qt@5.5 was deleted from homebrew/core in commit 3609232:
  qt@5.5: delete

So, now what?

@memoht @chrisortman Have you tried just downloading and installing QT5.5 directly from qt.io? Then symlinking with ln -s /Users/user/Qtx.x.x/x.x/clang_64/bin/qmake /usr/local/bin/qmake (filling the 'x' with your Qt version)

This is from here. Am about to do the same but the download of qt takes forever on the connection I am currently on.

mjankowski commented 6 years ago

FYI that approach suggested above does work.

I'm on Mojave with Xcode 10, and was able to download QT (including qmake) from the qt downloads page (its a 654M download from here). After going through the installer I added ~/Qt5.5.0/5.5/clang_64/bin to my path, and I was then able to gem install capybara-webkit.

So I think the state of affairs on Mojave might be that the previously recommended installation of going through homebrew is not going to work, but for anyone willing/able to get QT installed some other way will still be able to build capybara-webkit.

jferris commented 6 years ago

You can also use newer versions of Qt than 5.5, as long as you have a Qt distribution that includes QtWebKit. Newer versions have QtWebKit disabled by default, and QtWebKit is deprecated, but it was included long after 5.5 and may still be in recent versions.

agraves commented 5 years ago

For future people coming to this page, fix steps are:

  1. If you have added QT via brew trying to get this to work, clean up first:$ brew uninstall --force qt
  2. Download https://download.qt.io/archive/qt/5.5/5.5.0/qt-opensource-mac-x64-clang-5.5.0.dmg
  3. Run the installer
  4. Add the local install of qmake to your path, e.g. add this to ~/.bash_profile: export PATH="/Users/username/Qt5.5.0/5.5/clang_64/bin/:$PATH"
  5. Restart your terminal to get the new path. Verify with which cmake
  6. Accept the clickwrap $ sudo xcodebuild -license
  7. $ bundle upgrade capybara-webkit

And as an aside, I'm torn on whether I want to continue dealing with hacking Qt 5.5 every year or migrate to headless chrome on selenium and put up with its pedantic visibility rules. Neither option feels good.

jankeesvw commented 5 years ago

I just installed the .dmg mentioned by @agraves but I don't see cmake in the bin QT bin folder:


jankeesvw@jankees:~/Qt5.5.1/5.5/clang_64/bin
> ls
Assistant.app        qdbuscpp2xml         qmlplugindump
Designer.app         qdbusviewer.app      qmlprofiler
Linguist.app         qdbusxml2cpp         qmlscene
QMLViewer.app        qdoc                 qmltestrunner
fixqt4headers.pl     qhelpconverter       qt.conf
lconvert             qhelpgenerator       qtdiag
licheck_mac          qlalr                qtpaths
lrelease             qmake                qtplugininfo
lupdate              qml.app              rcc
macchangeqt          qml1plugindump       syncqt.pl
macdeployqt          qmleasing            uic
moc                  qmlimportscanner     xmlpatterns
qcollectiongenerator qmllint              xmlpatternsvalidator
qdbus                qmlmin
mjankowski commented 5 years ago

I think there's a typo in those instructions, and you are looking for qmake (and not cmake), which does appear to be listed there (and once added to your path, should enable the gem to be installed).

jankeesvw commented 5 years ago

I think there's a typo in those instructions, and you are looking for qmake (and not cmake), which does appear to be listed there (and once added to your path, should enable the gem to be installed).

Ah, right, yes qmake is there.

I still see this error when I'm installing capybara-webkit:


current directory: /Users/jankeesvw/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/capybara-webkit-1.15.0
make "DESTDIR="
cd src/ && ( test -e Makefile.webkit_server || /usr/local/opt/qt@5.5/bin/qmake /Users/jankeesvw/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/capybara-webkit-1.15.0/src/webkit_server.pro -o Makefile.webkit_server ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.webkit_server 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -pipe -O2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.7 -Wall -W -fPIC -DQT_NO_DEBUG -DQT_WEBKITWIDGETS_LIB -DQT_WIDGETS_LIB -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWebKitWidgets.framework/Headers -I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWebKit.framework/Headers -I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtNetwork.framework/Headers -I/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtCore.framework/Headers -Ibuild -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AGL.framework/Headers -I/usr/local/Cellar/qt@5.5/5.5.1_1/mkspecs/macx-clang -F/usr/local/Cellar/qt@5.5/5.5.1_1/lib -x c++-header -c stable.h -o build/webkit_server/c++.pch
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from stable.h:1:
In file included from /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWidgets.framework/Headers/QApplication:1:
In file included from /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWidgets.framework/Headers/qapplication.h:37:
In file included from /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtCore.framework/Headers/qcoreapplication.h:37:
/usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtCore.framework/Headers/qglobal.h:39:12: fatal error: 'cstddef' file not found
#  include <cstddef>
           ^~~~~~~~~
1 warning and 1 error generated.
make[1]: *** [build/webkit_server/c++.pch] Error 1
make: *** [sub-src-webkit_server-pro-make_first-ordered] Error 2

make failed, exit code 2
chrisortman commented 5 years ago

@jankeesvw I think you need to bundle update to 1.15.1

jankeesvw commented 5 years ago

I was on Bundler version 1.16.6, I updated to 1.17.1. After the update I still have the same error. Any other suggestions?

jankeesvw commented 5 years ago

Excuse me @chrisortman; after reading your answer for a second time I understand what you mean, and it worked! So for who end up on this GitHub issue thread, try this:

bundle update capybara-webkit --conservative

Thanks @chrisortman, @mjankowski 👏 🎉

georgeu2000 commented 5 years ago

I had this error after upgrading to Xcode 10.1 and Command Line Tools 10.13 for Xcode.

bundle update capybara-webkit --conservative

worked for me. Thanks!

EDIT: It just installed capybara-webkit v 1.15.1, which does not have the issue.

bundle update capybara-webkit

But better because it does not install newer versions of all the other gems.

mattgibson commented 5 years ago

For future people coming to this page, fix steps are:

  1. If you have added QT via brew trying to get this to work, clean up first:$ brew uninstall --force qt
  2. Download https://download.qt.io/archive/qt/5.5/5.5.0/qt-opensource-mac-x64-clang-5.5.0.dmg
  3. Run the installer
  4. Add the local install of qmake to your path, e.g. add this to ~/.bash_profile: export PATH="/Users/username/Qt5.5.0/5.5/clang_64/bin/:$PATH"
  5. Restart your terminal to get the new path. Verify with which cmake
  6. Accept the clickwrap $ sudo xcodebuild -license
  7. $ bundle upgrade capybara-webkit

And as an aside, I'm torn on whether I want to continue dealing with hacking Qt 5.5 every year or migrate to headless chrome on selenium and put up with its pedantic visibility rules. Neither option feels good.

I also needed to do this: https://stackoverflow.com/a/35098040/693349 so that I didn't get the error about the Xcode licence not being agreed to.

rwalbergpd commented 5 years ago

@mattgibson's instructions worked for me, though you want to run $ which qmake instead of $ which cmake and it's $ bundle update capybara-webkit not $ bundle upgrade capybara-webkit.

Thanks!

hendricius commented 5 years ago

All of this worked, except I had to install a real version of Xcode. I only had the command line tools installed. So now I had to invest 10 GB more of my disk, but at least it works again 😅

renatodeleao commented 5 years ago

I'm just a random dev trying to run bundle install to get going with my life, i hope this comment helps other in the same situation that land here.

I tried every single one of the strategies listed here, but unfortunatelly none of them solved the issue. For context I am running a brand new clean install of macOS 10.14.3 (mojave).

Desperated after a full afternoon trying to solve this, my attention was caught up by this 0 upvotes answer on stackoverflow that stated incompatibilities between qt@5.5 and Xcode10. I mean i've already tried everything else so why not?!

TL;DR: I've added Xcode 9.4.1 (you can have multiple installations of xcode) and everything worked as expected

Long answer:

  1. Install qt with brew following official instructions. (Although it might also work with the installer mentioned comment above)
  2. Download Xcode 9.4.1 and Xcode_9.4.1 command line tools installers.
  3. Extract and add it to apps folder (you might need to rename it to Xcode_9.4.1.app if you already have 10 installed).
  4. Run the Xcode_9.4.1 developers tools installer.
  5. run sudo xcode-select -p* => to check current path, should output /Applications/Xcode.app/Contents/Developer
  6. run sudo xcode-select -s /Applications/Xcode_9.4.1.app/Contents/Developer* => to set it to 9.4.1
  7. run bundle install (or gem install capybara-webkit)
  8. go grab yourself a beer 🍺, you deserve it.

*sudo might not be required sudo xcode-select -s /Applications/Xcode.app/Contents/Developer to set default back to v10

Good luck!

monsteronfire commented 5 years ago

@renatodeleao Thanks for this solution! It worked perfectly for me. 💯

frankliu81 commented 5 years ago

On mojave, setting up qt5.5 using a combination of agraves, mattgibson, and renatodeleao answer, but I also ran into the following error:

Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.
*** extconf.rb failed ***

Had to follow this: https://stackoverflow.com/questions/33728905/qt-creator-project-error-xcode-not-set-up-properly-you-may-need-to-confirm-t

cd /Applications/Xcode_9.4.1.app/Contents/Developer/usr/bin/
sudo ln -s xcodebuild xcrun

Then everything worked for me.

monsteronfire commented 5 years ago

If you're willing to move away from using capybara-webkit, altogether, I found this blog post helpful: https://artsy.github.io/blog/2018/11/27/switch-from-capybara-webkit-to-chrome/