thinkbot Suspenders gem - 即使在安装Qt后,'bundle install'也失败了capybara-webkit

时间:2015-04-15 02:58:56

标签: ruby-on-rails ruby qt installation gem

我试图使用ThoughtBot的Suspenders gem开始个人项目,并在运行bundle install时遇到capybara-webkit的错误。谷歌出现了一些类似的报道,大多数似乎是通过按照capybara-webkit GitHub here的说明安装Qt解决的(我注意到指令是针对OSX 10.9 Mavericks和10.8 Mountain Lion,而我'我使用10.10 Yosemite,但我没有特别注意10.10的任何内容。

  

如果在构建时出现错误,则会出现致命错误:   QObject:没有这样的文件或目录,您可能正在尝试构建   反对Qt3,或Qt4的早期版本。确保qmake中   你的PATH链接到Qt4.8。

which qmake # to see where it links
rm `which qmake` # IF it is linking to an old version

OSX说明如下:

  

访问QT网站(一般下载站点,4.8.6安装程序)和   下载Qt库4.8.6 for Mac(185 MB)和调试库(480   MB)。

所以我在链接下载并安装了两个Qt库。我从命令行获得以下输出:

Davids-MBP:app david$ which qmake
/usr/bin/qmake
Davids-MBP:app david$ qmake --version
QMake version 2.01a
Using Qt version 4.8.6 in /Library/Frameworks

然而,当我从我的应用程序中运行bundle install时,我得到了这个输出:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/david/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20150414-16090-1y906xu.rb extconf.rb 
WARNING: Ignored (not found) '/Users/david/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/capybara-webkit-1.5.0/src/webkit_server.pbproj'
make: *** No rule to make target `qmake'.  Stop.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/david/.rbenv/versions/2.2.1/bin/$(RUBY_BASE_NAME)
    --with-gl-dir
    --without-gl-dir
    --with-gl-include
    --without-gl-include=${gl-dir}/include
    --with-gl-lib
    --without-gl-lib=${gl-dir}/lib
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
Command 'make qmake' failed

extconf failed, exit code 1

Gem files will remain installed in /Users/david/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/capybara-webkit-1.5.0 for inspection.
Results logged to /Users/david/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/capybara-webkit-1.5.0/gem_make.out
An error occurred while installing capybara-webkit (1.5.0), and Bundler cannot continue.
Make sure that `gem install capybara-webkit -v '1.5.0'` succeeds before bundling.

我回去并删除了Qt,然后尝试根据链接文档从源代码构建它。这个过程如此错误:

Davids-MBP:app david$ brew install qt --build-from-source
==> Downloading https://download.qt.io/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz
######################################################################## 100.0%
==> Downloading https://raw.githubusercontent.com/DomT4/scripts/440e3cafde5bf6ec6f50cd28fa5bf89c280f1b53/Homebrew_R
######################################################################## 100.0%
==> Patching
patching file src/gui/dialogs/qcolordialog_mac.mm
patching file src/gui/dialogs/qfiledialog_mac.mm
patching file src/gui/dialogs/qfontdialog_mac.mm
patching file src/gui/kernel/qapplication_mac.mm
patching file src/gui/kernel/qcocoaapplication_mac.mm
patching file src/gui/kernel/qcocoaapplicationdelegate_mac.mm
Hunk #4 succeeded at 295 (offset -13 lines).
Hunk #5 succeeded at 342 (offset -13 lines).
patching file src/gui/kernel/qcocoaapplicationdelegate_mac_p.h
patching file src/gui/kernel/qcocoamenuloader_mac.mm
patching file src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
patching file src/gui/kernel/qeventdispatcher_mac.mm
patching file src/gui/kernel/qt_cocoa_helpers_mac.mm
patching file src/gui/kernel/qwidget_mac.mm
patching file src/gui/styles/qmacstyle_mac.mm
patching file src/gui/util/qsystemtrayicon_mac.mm
patching file src/gui/widgets/qcocoamenu_mac.mm
patching file src/gui/widgets/qmenu_mac.mm
==> ./configure -prefix /usr/local/Cellar/qt/4.8.6 -system-zlib -qt-libtiff -qt-libpng -qt-libjpeg -confirm-license
==> make
1 error generated.
make[2]: *** [.obj/release-shared/qglobal.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [release] Error 2
make: *** [sub-corelib-make_default-ordered] Error 2
READ THIS: https://git.io/brew-troubleshooting

有人可以帮忙吗?

我通过rbenv使用ruby 2.2.1。

1 个答案:

答案 0 :(得分:1)

检查App Store以查看您最近是否更新到命令行工具6.3。如果是这样,您需要安装6.3.1,该版本现已在Apple的开发者网站上提供:https://developer.apple.com/downloads/index.action#

此外,这是帮助我解决此问题的另一个StackOverflow问题: Missing C++ header <__debug> after updating OSX Command Line Tools 6.3