Help us understand the problem. What is going on with this article?

CentOS7にqmakeとcapybara-webkitをインストールする

More than 3 years have passed since last update.

概要

capybara-webkitをインストールしようとすると、qmakeコマンドがないといエラーが出てインストールできない。調べてみたことろ、CentOS7での解決方法がなかったので、CentOS6.4での対象方法を参考に、CentOS7でqmakeコマンドをインストールしてみた。

エラー内容

$ bundle install --path vendor/bundle
Installing capybara-webkit 1.11.1 with native extensions

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

    current directory: /home/vagrant/RSpec/vendor/bundle/ruby/2.3.0/gems/capybara-webkit-1.11.1
/home/vagrant/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20160725-8249-16gn6j5.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=/home/vagrant/.rbenv/versions/2.3.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 'qmake ' not available

extconf failed, exit code 1

Gem files will remain installed in /home/vagrant/RSpec/vendor/bundle/ruby/2.3.0/gems/capybara-webkit-1.11.1 for inspection.
Results logged to /home/vagrant/RSpec/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0-static/capybara-webkit-1.11.1/gem_make.out
Using poltergeist 1.10.0
An error occurred while installing capybara-webkit (1.11.1), and Bundler cannot continue.
Make sure that `gem install capybara-webkit -v '1.11.1'` succeeds before bundling.

qmakeのインストール手順

下記の内容で、/etc/yum.repos.d/qt.repoを作成する。
epel-7のレポジトリは存在しないので、baseurlの部分のepel-$releaseverを、epel-6に書き換える。

/etc/yum.repos.d/qt.repo
$ vi /etc/yum.repos.d/qt.repo

[epel-qt48]
name=Software Collection for Qt 4.8
#baseurl=http://repos.fedorapeople.org/repos/sic/qt48/epel-$releasever/$basearch/
baseurl=http://repos.fedorapeople.org/repos/sic/qt48/epel-6/$basearch/
enabled=1
skip_if_unavailable=1
gpgcheck=0

[epel-qt48-source]
name=Software Collection for Qt 4.8 - Source
#baseurl=http://repos.fedorapeople.org/repos/sic/qt48/epel-$releasever/SRPMS
baseurl=http://repos.fedorapeople.org/repos/sic/qt48/epel-6/SRPMS
enabled=0
skip_if_unavailable=1
gpgcheck=0

qtをインストール

$ sudo yum -y install qt48-qt-webkit-devel

qmakeコマンドのパスを通す

$ sudo ln -s /opt/rh/qt48/root/usr/include/QtCore/qconfig-64.h  /opt/rh/qt48/root/usr/include/QtCore/qconfig-x86_64.h
$ source /opt/rh/qt48/enable
$ export PATH=/opt/rh/qt48/root/usr/lib64/qt4/bin/${PATH:+:${PATH}}

まとめ

これでbundle installしたら、capybara-webkitのインストールに成功した。

以上

[参考]
http://tagamidaiki.com/capybara-webkit-qmake/

Esfahan
WEB系出身。現在はビッグデータの基盤構築、ETLなどがメイン。 / [YouTube] https://www.youtube.com/channel/UCeqPhExV09EF5o8lZLO15Eg / [クックパッド] https://cookpad.com/kitchen/13476667
https://www.youtube.com/channel/UCeqPhExV09EF5o8lZLO15Eg
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした