iconoclast
iconoclast

Reputation: 22610

Unable to install capybara-webkit on OS X

I have Qt 4.8.5 installed, which capybara-webkit requires, but for some reason my system seems to think I'm still using 4.7.x.

I removed 4.7.x—which was in /Developer/Applications— by removing /Developer/Applications, since Apple's Developer Tools no longer uses that location, and so Qt 4.7.x was the only thing there.

I reinstalled Qt 4.8.5 after removing Qt 4.7.x, and tried installing capybara-webkit, but no dice:

$ brew reinstall qt4
==> Reinstalling qt4
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/qt-4.8.5.mavericks.bottle.
Already downloaded: /Library/Caches/Homebrew/qt-4.8.5.mavericks.bottle.4.tar.gz
==> Pouring qt-4.8.5.mavericks.bottle.4.tar.gz
==> Caveats
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.

.app bundles were installed to /usr/local/Cellar/qt/4.8.5 (or libexec).
Run `brew linkapps` to symlink these to /Applications.
==> Summary
🍺  /usr/local/Cellar/qt/4.8.5: 2780 files, 120M
$ gem install capybara-webkit -v '1.1.1'
Building native extensions.  This could take a while...
ERROR:  Error installing capybara-webkit:
    ERROR: Failed to build gem native extension.

    /Users/brandon/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
cd src/ && /usr/bin/qmake /Users/brandon/.rvm/gems/ruby-2.0.0-p353/gems/capybara-webkit-1.1.1/src/webkit_server.pro -spec /usr/local/Qt4.7/mkspecs/macx-g++ -o Makefile.webkit_server
Project ERROR: At least Qt 4.8.0 is required to run capybara-webkit.
make: *** [sub-src-webkit_server-pro-qmake_all] Error 2
Command 'make qmake' failed

make "DESTDIR=" clean
cd src/ && /usr/bin/qmake /Users/brandon/.rvm/gems/ruby-2.0.0-p353/gems/capybara-webkit-1.1.1/src/webkit_server.pro -spec /usr/local/Qt4.7/mkspecs/macx-g++ -o Makefile.webkit_server
Project ERROR: At least Qt 4.8.0 is required to run capybara-webkit.
make: *** [src/Makefile.webkit_server] Error 2

make "DESTDIR="
cd src/ && /usr/bin/qmake /Users/brandon/.rvm/gems/ruby-2.0.0-p353/gems/capybara-webkit-1.1.1/src/webkit_server.pro -spec /usr/local/Qt4.7/mkspecs/macx-g++ -o Makefile.webkit_server
Project ERROR: At least Qt 4.8.0 is required to run capybara-webkit.
make: *** [src/Makefile.webkit_server] Error 2

make failed, exit code 2

Gem files will remain installed in /Users/brandon/.rvm/gems/ruby-2.0.0-p353/gems/capybara-webkit-1.1.1 for inspection.
Results logged to /Users/brandon/.rvm/gems/ruby-2.0.0-p353/extensions/x86_64-darwin-12/2.0.0-static/capybara-webkit-1.1.1/gem_make.out

If I run brew linkapps it creates symlinks for *.App files in /Applications, but it doesn't seem to do anything that is relevant too capybara-webkit installation. I'm not sure what should be linked where, or if that's the problem, but other Homebrew-installed software seems to get linked to /usr/local/bin/. There's nothing that seems Qt-related in there, though:

$ ls /usr/local/bin/q*
/usr/local/bin/qcollectiongenerator /usr/local/bin/qmake
/usr/local/bin/qdoc3                /usr/local/bin/qmlplugindump
/usr/local/bin/qhelpgenerator       /usr/local/bin/qt3to4

What's the problem? How do I fix it?

Upvotes: 1

Views: 2430

Answers (1)

iconoclast
iconoclast

Reputation: 22610

The problem appears to be that the first qmake in the PATH is a symlink to a 4.7 version:

$ ls -hal `which qmake`
lrwxr-xr-x  1 507  wheel     9B Aug  8  2012 /usr/bin/qmake -> qmake-4.7

After getting rid of that (sudo rm /usr/bin/qmake), the version of qmake that is used is correct:

$ which qmake
/usr/local/bin/qmake

Now I can successfully install capybara-webkit:

$ gem install capybara-webkit -v '1.1.1'
Building native extensions.  This could take a while...
Successfully installed capybara-webkit-1.1.1
Parsing documentation for capybara-webkit-1.1.1
Installing ri documentation for capybara-webkit-1.1.1
Done installing documentation for capybara-webkit after 1 seconds
1 gem installed

Upvotes: 4

Related Questions