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

标签 ruby qt gem osx-elcapitan

升级到 El Capitan 后,我在安装 capybara-webkit 时遇到问题。 QT 版本 qt-4.8.7_1 已经安装。 bundle 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

完整日志:enter link description here

最佳答案

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

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

关于ruby - 无法在 OS X El Capitan 上安装 capybara-webkit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34015386/

相关文章:

c++ - Qt - 在文件开头重复写入

ruby - Rails 3 runner 没有检测到 JSON gem?

ruby-on-rails - Rails gem 在执行 "rake test"时使用开发数据库而不是测试数据库

ruby-on-rails - 您可以将 Redis 与 Resque 一起使用吗?

ruby - 如何删除第一个空格或一定数量的字符后的所有内容?

c++ - Qt MainWindow CloseEvent Mac Cmd+Q

c++ - 使用 Qt::X11BypassWindowManagerHint 标志时窗口没有获得焦点

ruby - 用于匹配德国邮政编码但不匹配的正则表达式

ruby - 数字1上的实例方法从何而来

ruby-on-rails - 将 HashMap 映射到类实例