Cannot install capybara-webkit gem

2019-08-04 11:16发布

问题:

This is really a tough one for me. I'm trying to migrate over to Mountain Lion but I get the following when trying to install capybara-webkit.

The initial error:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

            /Users/martinb/.rvm/rubies/ruby-1.9.3-p374/bin/ruby extconf.rb 
    cd src/ && /usr/bin/qmake /Users/martinb/.rvm/gems/ruby-1.9.3-p374/gems/capybara-webkit-0.14.1/src/webkit_server.pro -spec /usr/local/Qt4.7/mkspecs/macx-g++ -o Makefile.webkit_server
    cd src/ && make -f Makefile.webkit_server 
    g++ -c -pipe -g -gdwarf-2 -Wall -W -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.7/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/usr/include/QtNetwork -I/usr/include/QtGui -I/Library/Frameworks/QtWebKit.framework/Versions/4/Headers -I/usr/include/QtWebKit -I/usr/include -I. -F/Library/Frameworks -o EnableLogging.o EnableLogging.cpp
    In file included from /Library/Frameworks/QtCore.framework/Headers/qnamespace.h:45,
                     from /Library/Frameworks/QtCore.framework/Headers/qobjectdefs.h:45,
                     from /Library/Frameworks/QtCore.framework/Versions/4/Headers/qobject.h:47,
                     from /Library/Frameworks/QtCore.framework/Versions/4/Headers/QObject:1,
                     from SocketCommand.h:4,
                     from EnableLogging.h:1,
                     from EnableLogging.cpp:1:
    /Library/Frameworks/QtCore.framework/Headers/qglobal.h:320:6: warning: #warning "This version of Mac OS X is unsupported"
    g++ -c -pipe -g -gdwarf-2 -Wall -W -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.7/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/usr/include/QtNetwork -I/usr/include/QtGui -I/Library/Frameworks/QtWebKit.framework/Versions/4/Headers -I/usr/include/QtWebKit -I/usr/include -I. -F/Library/Frameworks -o Authenticate.o Authenticate.cpp
    In file included from /Library/Frameworks/QtCore.framework/Headers/qnamespace.h:45,
                     from /Library/Frameworks/QtCore.framework/Headers/qobjectdefs.h:45,
                     from /Library/Frameworks/QtCore.framework/Versions/4/Headers/qobject.h:47,
                     from /Library/Frameworks/QtCore.framework/Versions/4/Headers/QObject:1,
                     from SocketCommand.h:4,
                     from Authenticate.h:1,
[...]
    make[1]: *** [Authenticate.o] Error 1
    make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2


    Gem files will remain installed in /Users/martinb/.rvm/gems/ruby-1.9.3-p374/gems/capybara-webkit-0.14.1 for inspection.
    Results logged to /Users/martinb/.rvm/gems/ruby-1.9.3-p374/gems/capybara-webkit-0.14.1/./gem_make.out

So I installed the latest qt using homebrew:

> brew install qt
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/qt-4.8.2.mountainlion.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring qt-4.8.2.mountainlion.bottle.1.tar.gz
==> Caveats
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.
==> Summary