5

I am trying to install the capybara-webkit gem on Amazon Linux AMI release 2017.09.

I tried following the install instructions for CentOS (maybe the wrong approach):

sudo yum install -y epel-release
sudo yum install -y qt5-qtwebkit-devel

The first package installed fine, but qt5-qtwebkit-devel gave the following error:

Error: Package: qt5-qtbase-gui-5.6.1-3.el6.x86_64 (epel)
       Requires: libgdk-x11-2.0.so.0()(64bit)
Error: Package: qt5-qtbase-gui-5.6.1-3.el6.x86_64 (epel)
       Requires: libgdk_pixbuf-2.0.so.0()(64bit)
Error: Package: qt5-qtbase-gui-5.6.1-3.el6.x86_64 (epel)
       Requires: libatk-1.0.so.0()(64bit)
Error: Package: qt5-qtbase-gui-5.6.1-3.el6.x86_64 (epel)
       Requires: libgtk-x11-2.0.so.0()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

I am unable to resolve the libgdk_pixbuf-2.0.so.0 dependency in Amazon Linux. I tried installing libX11-devel but that did not resolve the issue.

Of course gem install capybara-webkit -v '1.10.1' fails because qt5 is not installed.

I found a blog with instructions for installing capybara with qt-4.8, I would rather use the latest version and would prefer to use a package manager instead of compiling the package manually.

My question is, how can I install capybara-webkit on Amazon Linux AMI using the package managers?

Tom Aranda
  • 5,919
  • 11
  • 35
  • 51

2 Answers2

3

Amazon AMI doesn’t have a yum repo for the libgtk-x11-2.0.so.0. So you need to install other distro packages. In this case, did used CentOS.

$ sudo yum install ftp://ftp.riken.jp/Linux/centos/6/os/x86_64/Packages/hicolor-icon-theme-0.11-1.1.el6.noarch.rpm

$ sudo yum install ftp://ftp.riken.jp/Linux/centos/6/os/x86_64/Packages/atk-1.30.0-1.el6.x86_64.rpm

$ sudo yum install ftp://ftp.riken.jp/Linux/centos/6/os/x86_64/Packages/gdk-pixbuf2-2.24.1-6.el6_7.x86_64.rpm

$ sudo yum install ftp://ftp.riken.jp/Linux/centos/6/os/x86_64/Packages/gtk2-2.24.23-9.el6.x86_64.rpm

Once the packages are install the setup should work for you

PS: Source https://ubunifu.co/python/installing-libgtk-x11-2-0-so-0-in-amazon-linux-ami-2017-03-1

Tarun Lalwani
  • 142,312
  • 9
  • 204
  • 265
1

I'm using chef but this is where I got the necessary dependencies. just add this repo to yum repos, and then do the install

yum_repository 'centos-base' do
 url 'http://mirror.centos.org/centos/6/os/x86_64/'
 gpgkey 'http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6'
 action :add
end

package 'qt5-qtwebkit-devel'
willz
  • 2,020
  • 3
  • 21
  • 24
  • I managed to install `qt5-qtwebkit-devel` using a variation of the above procedure, but `gem install` still cannot find `qmake`. Do you know where `qmake` would be installed? – Tom Aranda Apr 02 '18 at 15:02
  • upon install you should have qmake in /usr/bin/qmake-qt5, which I just symlink as qmake – willz Apr 02 '18 at 18:49
  • Hmm. No there and `which qmake-qt5` comes up empty. – Tom Aranda Apr 02 '18 at 20:35
  • I phrased that wrong in my last comment, you should see qmake-qt5 in /usr/bin as a file. qmake-qt5 isn't a directory. so even if you list the contents of /usr/bin you dont see any qmake-**** anything? – willz Apr 02 '18 at 22:35
  • I didn't see anything because the install never completed. Silly me. I did finally get it to install using @Tarun's recommendation. Thanks for your help. This answer helped me add the centos mirror. – Tom Aranda Apr 05 '18 at 06:17
  • glad to help, they were pretty much the same thing. as long as centos repo and epel-release repo were enabled, doing yum install qt5-qtwebkit-devel. would have installed the qt webkit package with dependencies saving you from having to individually yum install the missing dependencies. – willz Apr 05 '18 at 06:28
  • I tried both and the other one worked. I am not sure why the centos mirror you recommended would not load `hicolor-icon-theme` – Tom Aranda Apr 05 '18 at 15:00