NOTE: IAmNaN here... this answer worked find for El Cap and Yosemite but it is no longer relevant as of MacOS Sierra. Instead follow the instructions from Thoughtbot. To summarize...
- Download and install a new Qt from here.
- Edit
~/Qt5.5.1/5.5/clang_64/mkspecs/features/mac/default_pre.prf
.
- Around line 15 find and replace
-find xcrun 2
with -find xcodebuild 2
.
- Save and run
PATH=~/Qt5.5.1/5.5/clang_64/bin:$PATH gem install capybara-webkit
Now back to our regularly scheduled answer....
I got this to work on OSX Yosemite. The reason for building against Qt5 was to get some fixes not in Qt4 that prevented capybara-webkit from using font and stylesheet assets in some circumstances.
Comment out the capybara and capybara-webkit gems from your gemfile. Then:
bundle
gem uninstall capybara-webkit
gem uninstall capybara # if it complains about dependencies 'gem uninstall' them first
brew remove qt
brew remove qt5 # if you've been playing around
From a clean environment (restart your terminal):
brew tap homebrew/versions
brew install qt55
brew linkapps qt55
brew link --force qt55
Uncomment capybara and capybara-webkit in the gemfile and then:
bundle install
Note: You may safely ignore the "brew unlink" warnings issued by brew doctor
.