无法在OS X El Capitan上安装capybara-webkit

升级到El Capitan后,我遇到安装capybara-webkit的问题。 已安装QT版本qt-4.8.7_1bundle install给出权限错误, sudo gem install给出了另一个错误:

捆绑安装:

 ~/P/m/web-automation (responsive ⚡=) bundle install Fetching gem metadata from http://rubygems.org/......... Fetching version metadata from http://rubygems.org/... Fetching dependency metadata from http://rubygems.org/.. Resolving dependencies... .... Installing capybara-webkit 1.7.1 with native extensions Errno::EACCES: Permission denied @ rb_sysopen - /usr/local/lib/ruby/gems/2.2.0/gems/capybara-webkit-1.7.1/.gitignore An error occurred while installing capybara-webkit (1.7.1), and Bundler cannot continue. Make sure that `gem install capybara-webkit -v '1.7.1'` succeeds before bundling. 

gem安装:

 ~/P/m/web-automation (responsive ⚡=) sudo gem install capybara-webkit -v '1.7.1' Building native extensions. This could take a while... ERROR: Error installing capybara-webkit: ERROR: Failed to build gem native extension. current directory: /usr/local/lib/ruby/gems/2.2.0/gems/capybara-webkit-1.7.1 /usr/local/opt/ruby/bin/ruby -r ./siteconf20151201-8173-19fj5gv.rb extconf.rb cd src/ && /usr/local/bin/qmake /usr/local/lib/ruby/gems/2.2.0/gems/capybara-webkit-1.7.1/src/webkit_server.pro LIBS\ +=\ -L/usr/local/opt/libyaml/lib\ -L/usr/local/opt/openssl/lib\ -L/usr/local/opt/readline/lib -o Makefile.webkit_server cd src/ && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.webkit_server clang++ -pipe -stdlib=libc++ -mmacosx-version-min=10.7 -O2 -arch x86_64 -Wall -W -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Cellar/qt/4.8.7_1/mkspecs/unsupported/macx-clang-libc++ -I. -I/usr/local/Cellar/qt/4.8.7_1/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtWebKit.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtWebKit.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/include -Ibuild -F/usr/local/Cellar/qt/4.8.7_1/lib -x c++-header -c stable.h -o build/webkit_server/c++.pch clang -pipe -mmacosx-version-min=10.7 -O2 -arch x86_64 -Wall -W -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Cellar/qt/4.8.7_1/mkspecs/unsupported/macx-clang-libc++ -I. -I/usr/local/Cellar/qt/4.8.7_1/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtWebKit.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/lib/QtWebKit.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7_1/include -Ibuild -F/usr/local/Cellar/qt/4.8.7_1/lib -x objective-c++-header -c stable.h -o build/webkit_server/objective-c++.pch 

完整日志: 在此处输入链接描述

 $ brew install qt $ brew link --overwrite qt $ bundle install 

为我工作(rbenv / Yosemite 10.10.5(14F27))

简而言之:

 $ brew upgrade $ which qmake $ rm `which qmake` $ brew install qt5 $ brew link --force qt5 $ bundle install 

基于:

  • capybara-webkitが捆绑安装できなかった话
  • OS X El Capitan 10.11和Yosemite 10.10

PS和作为主要的解决方法 – 使用Poltergeist 。 它们具有任何操作系统的二进制数据包和0安装问题。