我希望使用qt5的QtWebKit
来配合capybara-webkit
使用。
brew uninstall qt
Uninstalling /usr/local/Cellar/qt/4.8.4...
brew install qt5
This formula is keg-only: so it was not symlinked into /usr/local.
/usr/local/Cellar/qt5/5.0.2: 3103 files, 140M, built in 60.9 minutes
如果我强制使用brew为qt5创建符号链接,我就可以构建capybara-webkit的本地扩展。
brew link --force qt5
Linking /usr/local/Cellar/qt5/5.0.2... 122 symlinks created
gem install capybara-webkit -v '1.0.0'
Successfully installed capybara-webkit-1.0.0
但是webkit_server
崩溃得非常严重。
bundle exec rake test:integration
Errno::EADDRNOTAVAIL: Can't assign requested address - connect(2)
dyld: Library not loaded: /private/tmp/qt5-KytU/qt-everywhere-opensource-src-5.0.2/qtwebkit/lib/QtWebKit.framework/Versions/5/QtWebKit
Referenced from: /usr/local/opt/qt5/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
Reason: image not found
请参考完整的OSX崩溃报告。
我尝试使用LDFLAGS
和CPPFLAGS
安装capybara-webkit,但webkit_server
仍然严重崩溃。
env LDFLAGS=-L/usr/local/opt/qt5/lib \
CPPFLAGS=-I/usr/local/opt/qt5/include \
gem install capybara-webkit -v '1.0.0'