简体   繁体   中英

thoughtbot Suspenders gem - 'bundle install' fails with capybara-webkit even after installing Qt

I'm trying to use the Suspenders gem by ThoughtBot to start out a personal project and ran into an error with capybara-webkit when running bundle install . Google turned up a few similar reports and most seemed to be solved by installing Qt per the instructions at the capybara-webkit GitHub here (I noticed the instructions are for OSX 10.9 Mavericks and 10.8 Mountain Lion, whereas I'm using 10.10 Yosemite, but I don't see anything for 10.10 specifically).

If you get an error when building, along the lines of fatal error: QObject: No such file or directory, you might be attempting the build against Qt3, or an earlier version of Qt4. Make sure that the qmake in your PATH links to Qt4.8.

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

Instructions for OSX are:

Go to the QT website (general downloads site, 4.8.6 installers) and download Qt libraries 4.8.6 for Mac (185 MB) and debug libraries (480 MB).

So I downloaded and installed the two Qt libraries at the link. I get the following output from my command line:

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

However, when I run bundle install from within my app, I get this output:

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.

I went back and removed Qt, then tried building it from source per the linked doc. That process errored out like so:

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

Can anyone help?

I'm using ruby 2.2.1 through rbenv.

Check the App Store to see if you recently updated to Command Line Tools 6.3. If so, you'll need to install 6.3.1 which is now available on Apple's developer site: https://developer.apple.com/downloads/index.action#

Also, here's another StackOverflow issue that helped me solve this problem: Missing C++ header <__debug> after updating OSX Command Line Tools 6.3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM