production.log

株式会社リブセンスでエンジニアをやっている星直史のブログです。

Qtがないとcapybara-webkitがbundle installできないので対処する方法

概要

Qtがないとcapybara-webkitをinstallできないって毎回怒られるんだけど、
毎回やりかた忘れちゃうのでメモ

手順

Qtのインストール

# qt4
$ wget https://download.qt.io/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz
$ tar xzvf qt-everywhere-opensource-src-4.8.7.tar.gz
$ rm qt-everywhere-opensource-src-4.8.7.tar.gz
$ cd qt-everywhere-opensource-src-4.8.7
$ ./configure -opensource -nomake examples -nomake tests
$ sudo gmake -j2 # 2並列で1時間くらいかかる
$ sudo gmake install
$ sudo ln -s /usr/local/Trolltech/Qt-4.8.7/bin/qmake /usr/bin/qmake

# qt5
$ more /etc/yum.repos.d/cent6.repo
[CentOS6riken]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=ftp://ftp.riken.jp/Linux/centos/6/os/x86_64/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
$ sudo yum install qt5-qtwebkit-devel
$ sudo ln -s /usr/lib64/qt5/bin/qmake /usr/bin/qmake

Xvfbのインストール

Qtをインストールした後にbundle installをするとHeadless::Exception: Xvfb not found on your systemと怒られるので、Xvfbをインストールする。

sudo yum install -y libXcomposite.x86_64 xorg-x11-server-Xvfb.x86_64