LoginSignup
21
16

More than 5 years have passed since last update.

capybara-webkit が bundle install できなかった話

Last updated at Posted at 2015-10-23

OS: MacOS X El Capitan

最近はごちうさでこころがぽいぽいしています。

ある Rails のプロジェクトで bundle install したところ、 capybara-webkitがインストールできずにハマったお話です。
結論からいうと、brew upgrade したあとで後述の手順通りにしたらいけました。

きっかけ

ある Rails のプロジェクトで bundle install したところ、

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

    /Users/akito/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20151023-29612-1v0p8sd.rb extconf.rb
QMAKESPEC has not been set, so configuration cannot be deduced.
Error processing project file: /Users/akito/git/project/vendor/bundle/gems/capybara-webkit-1.7.1/webkit_server.pro
*** 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/akito/.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 ' failed

extconf failed, exit code 1

Gem files will remain installed in /Users/akito/git/project/vendor/bundle/gems/capybara-webkit-1.7.1 for inspection.
Results logged to /Users/akito/git/project/vendor/bundle/extensions/x86_64-darwin-15/2.2.0-static/capybara-webkit-1.7.1/gem_make.out
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.

と怒られてしまいました。

対応 1

$ brew install qt
$ bundle install

そもそも Qt がないからできないのではと capybara-webkit をプロジェクトに入れた張本人に言われたのでやってみました。
ちなみに僕の場合はダメで、上記のようなエラーになりました。

対応 2

ネットの海に潜って見つけたページの通りにやってみる 。

を参考にしました。

結論からいうと、僕は何も変わりませんでした。

$ which qmake

すると、 本来 /user/local/bin/qmake となっていてほしいのに、 anaconda の配下に qmake がいました。最近一切使ってなかった Python に首閉められました。

対応 3

もういっそのこと brew upgrade とかしてみるかとなったので、やってみました。

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

できました。結局原因がわからずじまいだったのですが、 Homebrew を全然 upgrade してなかったのが原因なんでしょうか。。

upgrade していくのって大事ですね。

21
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
16