1

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
  /usr/local/Cellar/qt/4.8.2: 2752 files, 197M

Then:

> gem install capybara-webkit

Building native extensions.  This could take a while...
ERROR:  Error installing capybara-webkit:
    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
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
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 SetConfirmAction.o SetConfirmAction.cpp
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 SetPromptAction.o SetPromptAction.cpp
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 SetPromptText.o SetPromptText.cpp
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 ClearPromptText.o ClearPromptText.cpp
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 JavascriptAlertMessages.o JavascriptAlertMessages.cpp
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 JavascriptConfirmMessages.o JavascriptConfirmMessages.cpp
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 JavascriptPromptMessages.o JavascriptPromptMessages.cpp
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 IgnoreSslErrors.o IgnoreSslErrors.cpp
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 ResizeWindow.o ResizeWindow.cpp
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 CurrentUrl.o CurrentUrl.cpp
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 ConsoleMessages.o ConsoleMessages.cpp
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 main.o main.cpp
main.cpp:2:17: error: QtGui: No such file or directory
main.cpp: In function ‘int main(int, char**)’:
main.cpp:16: error: ‘QApplication’ was not declared in this scope
main.cpp:16: error: expected `;' before ‘app’
main.cpp:17: error: ‘app’ was not declared in this scope
main.cpp: At global scope:
main.cpp:8: warning: unused parameter ‘argc’
main.cpp:8: warning: unused parameter ‘argv’
make[1]: *** [main.o] Error 1
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2
Command 'make' failed

make
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 main.o main.cpp
main.cpp:2:17: error: QtGui: No such file or directory
main.cpp: In function ‘int main(int, char**)’:
main.cpp:16: error: ‘QApplication’ was not declared in this scope
main.cpp:16: error: expected `;' before ‘app’
main.cpp:17: error: ‘app’ was not declared in this scope
main.cpp: At global scope:
main.cpp:8: warning: unused parameter ‘argc’
main.cpp:8: warning: unused parameter ‘argv’
make[1]: *** [main.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

I'm really, really stuck. Is there a solution for this? Thank you so much in advance.

Marcin Bilski
  • 572
  • 6
  • 13
  • You might want to try removing every bit of the older Qt install. I just installed qt 4.8.4 (no previous install) from brew + capybara-webkit and had no errors. – Paul Kehrer Feb 01 '13 at 02:00
  • Paul, thank you. To the best of my knowledge, the previous Qt was installed using macports. I removed all ports and macports itself. But in case there's an older version, what to look for and how to remove it? Thank you for any hints you can offer. – Marcin Bilski Feb 01 '13 at 02:05
  • Based on your first error msg it looks like you may have an old QtCore here: /Library/Frameworks/QtCore.framework – Paul Kehrer Feb 01 '13 at 02:08
  • I renamed the dir and now: http://pastie.org/6002106 UPDATE: Forgot to mention that I did that after renaming the dir: > brew uninstall qt > brew install qt – Marcin Bilski Feb 01 '13 at 02:14

1 Answers1

0

Whoa! I followed Paul's advice (THANK YOU Paul!) plus linked qmake to the new version. (Was 4.7.3, I needed it to use the latest 4.8.2).

Hint: qmake -v to see which version is in use.

Had I only known this... :P

Marcin Bilski
  • 572
  • 6
  • 13