Unable to install capybara-webkit with OS X Sierra
Asked Answered
L

2

9

I've been trying to install the Capybara-Webkit gem with bundler and after following these instructions: https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit#macos-sierra-1012

I keep running into the error of the Makefile not being found. I've updated Homebrew, the gem system, and updated Xcode 8 with cli tools to no avail. Would really appreciate any help!

sudo gem install capybara-webkit PATH=/Users/caren/Qt5.5.1/5.5/clang_64/bin:$PATH gem install capybara-webkit
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing capybara-webkit:
    ERROR: Failed to build gem native extension.

    /Users/caren/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20161108-5610-m00680.rb extconf.rb
*** 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/caren/.rbenv/versions/2.2.3/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 'qmake ' not available

extconf failed, exit code 1

Gem files will remain installed in /Users/caren/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/capybara-webkit-1.11.1 for inspection.
Results logged to /Users/caren/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/capybara-webkit-1.11.1/gem_make.out
ERROR:  Could not find a valid gem 'PATH=/Users/caren/Qt5.5.1/5.5/clang_64/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/Users/caren/.nvm/versions/node/v5.4.0/bin:/Users/caren/.rbenv/shims:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/heroku/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/Users/caren/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin' (>= 0) in any repository
ERROR:  Could not find a valid gem 'gem' (>= 0) in any repository
ERROR:  Could not find a valid gem 'install' (>= 0) in any repository
ERROR:  Possible alternatives: installr, instant, instana, instacli, instapi
Building native extensions.  This could take a while...
ERROR:  Error installing capybara-webkit:
    ERROR: Failed to build gem native extension.

    /Users/caren/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20161108-5610-97n2eh.rb extconf.rb
*** 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/caren/.rbenv/versions/2.2.3/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 'qmake ' not available

extconf failed, exit code 1

Gem files will remain installed in /Users/caren/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/capybara-webkit-1.11.1 for inspection.
Results logged to /Users/caren/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/capybara-webkit-1.11.1/gem_make.out 
Lasting answered 8/11, 2016 at 22:18 Comment(4)
how did you install QT?Uncover
you should be running PATH=/Users/caren/Qt5.5.1/5.5/clang_64/bin:$PATH gem install capybara-webkit not gem install capybara-webkit PATH=/Users/caren/Qt5.5.1/5.5/clang_64/bin:$PATH gem install capybara-webkit and when/if that fails look at the mkmf.log mentioned in the error message to see what errors are occurringAxum
superuser.com/questions/256232/how-can-i-get-qmake-on-mac-os-xSun
@fabersky I installed it from the Qt website.Cann
T
12

The following did the trick for me (using Homebrew):

brew install qt5 --with-qtwebkit
brew link --force qt5
gem install capybara-webkit

Note: It will take a while to install the first step, and you'll need to have Xcode installed.

Tensiometer answered 1/12, 2016 at 12:4 Comment(4)
Thanks Mike! Tried your steps and worked out for me. :)Cann
Thanks mate! Took a long time to compile/make but did worked out. Many many Kudos! :)Spenser
no kidding about that first command taking a very long time. all 3 command worked like a charmed! thanks mate!!Ohl
Just a side note that this will break on brew upgrade.Uneducated
U
0

I hope it will help someone.

brew install qt5 --with-qtwebkit
brew install [email protected] or brew reinstall [email protected]

echo ‘export PATH=“/usr/local/opt/[email protected]/bin:$PATH”’ >> ~/.bash_profile
source ~/.bash_profile

brew unlink [email protected] && brew link --force [email protected]
Unreality answered 16/11, 2018 at 8:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.