Error installing gem capybara-webkit

RubyGemCapybara

Ruby Problem Overview


I am new to ruby, but while trying to install capybara to run test on my system I get the following error. Im running OSX

my_app$ gem install capybara-webkit
Building native extensions.  This could take a while...
ERROR:  Error installing capybara-webkit:
ERROR: Failed to build gem native extension.

/Users/joe/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb

Gem files will remain installed in /Users/joe/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.7.2 for inspection.
Results logged to /Users/joe/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.7.2/./gem_make.out

here are results from gem_make.out

/Users/joe/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb

Ruby Solutions


Solution 1 - Ruby

Try installing libqt via homebrew.

$ brew install qt@5.5

Solution 2 - Ruby

Solution for Linux.

Ubuntu

sudo apt-get install libqt4-dev libqtwebkit-dev

Debian Stable

sudo apt-get install libqt4-dev

Fedora

yum install qt-webkit-devel

Fedora 16

yum install qtwebkit-devel

This works for me maybe it will be also helpful for somebody.

Solution 3 - Ruby

brew install qt@5.5

and then

gem install capybara-webkit -v '0.7.2'

-v 0.7.2 is to select version project is asking you to install. See that installing qt from http://developer.qt.nokia.com/wiki/Support_for_Mac_OS_X requires to set PATH variable.

Solution 4 - Ruby

Was having exactly this problem trying to install capybara-webdriver on CentOS 6 after installing QT.

Fixed the problem by adding the following to my PATH environment variable

/usr/lib64/qt4/bin/

Solution 5 - Ruby

For OSX, I had to

brew install qt

and then

sudo gem install capybara-webkit -v '0.7.2'

without sudo it would error

Solution 6 - Ruby

macOS Sierra 10.12, El Capitan 10.11 and Yosemite 10.10

Install with either homebrew or macports Homebrew

Qt 5.5 is the last version of Qt that capybara-webkit will support. The Qt project has dropped the WebKit bindings from binary releases in 5.6.

Install Qt 5.5 with homebrew:

brew install qt@5.5

The Homebrew formula for qt55 is keg only which means binaries like qmake will not be symlinked into your /usr/local/bin directory and therefore will not be available for capybara-webkit.

To force Homebrew to symlink those binaries into your /usr/local/bin directory you can run:

brew link --force qt55

After running this command you should get the following output:

$ which qmake
/usr/local/bin/qmake

Macports

Install qt5 with macports:

sudo port install qt5 qt5-qtwebkit # It's not qt5-mac anymore.

The default location for qt5's qmake is /opt/local/libexec/qt5/bin/qmake. If the qmake on path is different, you can indicate the correct one with QMAKE environment variable.

QMAKE=/opt/local/libexec/qt5/bin/qmake gem install capybara-webkit

Solution 7 - Ruby

For Debian & Ubuntu

sudo apt-get update sudo apt-get install g++ qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x

You can find other ways to install Qt here

Solution 8 - Ruby

QT was the answer for me, thougtbot provide a comprehensive installation options here:

https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit

Generally depending on where you have home brew, this worked for me:

brew update
brew install qt
gem install capybara-webkit

Solution 9 - Ruby

On OSX Mavericks 10.9, qt5 does not install qmake. This post was the only thing that worked for me.

> Step 1: Download Qt 5.2.0-beta-1-clang HERE. > >Step 2: Install it and include the Src files. > >Step 3: Symlink qmake into your /bin directory from the location where you installed Qt. The default location is in your home directory. Open a shell and do something like:

 ln -s /Path/to/where/you/installed/Qt5.2/5.2.0-beta1/clang_64/bin/qmake /usr/local/bin/qmake

Then gem install capybara-webkit.

Solution 10 - Ruby

I am using Yosemite and following commands has fixed my issue.

brew install qt
brew linkapps qt
gem install capybara-webkit

Solution 11 - Ruby

Here are the complete steps to install Capybara-webkit in all the OS

  1. Install QT - http://qt-project.org/downloads
   brew install qt
  1. ln -s /usr/local/Cellar/qt5/5.4.1/bin/qmake /usr/local/bin/qmake

  2. sudo port install qt4-mac-devel

Reference: Capybara Installation

Solution 12 - Ruby

For fedora

yum install qt-webkit-devel
export QMAKE=/usr/bin/qmake-qt4
gem install capybara-webkit

Solution 13 - Ruby

I was able to get qt and capybara-webkit installed and working on OS X. I had to install Xcode so the build for

gem install capybara-webkit

would finish.

I also set this in my environment

Capybara.javascript_driver = :webkit

brew install qt5 to get latest qt.

The docs for it say that it conflicts with qt4, so be sure to remove that first with

brew uninstall [old qt]

Then it needs to be symlinked with

brew link --force qt5

Solution 14 - Ruby

I've got error in my mac OS X 10.12, and this fixed the problem.

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questioneiu165View Question on Stackoverflow
Solution 1 - RubyjeffluntView Answer on Stackoverflow
Solution 2 - RubySuborxView Answer on Stackoverflow
Solution 3 - RubysitesView Answer on Stackoverflow
Solution 4 - RubyRobView Answer on Stackoverflow
Solution 5 - RubyrobertjloobyView Answer on Stackoverflow
Solution 6 - RubyMoharnab SaikiaView Answer on Stackoverflow
Solution 7 - RubyWladimir GramachoView Answer on Stackoverflow
Solution 8 - RubyKingsley IjomahView Answer on Stackoverflow
Solution 9 - RubyMarian MosleyView Answer on Stackoverflow
Solution 10 - RubymfqView Answer on Stackoverflow
Solution 11 - RubyAravinView Answer on Stackoverflow
Solution 12 - Rubyraju guptaView Answer on Stackoverflow
Solution 13 - RubyAnthony SallowsView Answer on Stackoverflow
Solution 14 - RubyVibolView Answer on Stackoverflow