Not able to install capybara-webkit using bundle install command in Rails 4
Asked Answered
K

6

17

I am getting following error while executing command bundle install in my Rails 4 application.

> ruby -v
ruby 2.1.8p440 (2015-12-16 revision 53160) [i386-mingw32]

> rails --version
Could not find gem 'capybara-webkit x86-mingw32' in any of the gem sources listed in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.

My Gemfile

...
.....
group :development, :localtesting, :test do
  gem 'sqlite3',     '1.3.11'
  gem 'byebug',      '3.4.0'
  #gem 'web-console', '2.0.0.beta3'
  gem 'spring',      '1.1.3'
  gem 'i18n-tasks'
  gem 'capybara'
  gem 'selenium-webdriver'
  gem 'rspec'
  gem 'rspec-rails'
  gem 'rspec_junit_formatter'
  gem 'capybara-webkit'
end
.....
...

Error

Installing capybara-webkit 1.10.1 with native extensions

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

    C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe 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=C:/RailsInstaller/Ruby2.1.0/bin/ruby
        --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 C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/capybara-webkit-1.10.1 for inspection.
Results logged to C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/capybara-webkit-1.10.1/gem_make.out
Using guard-minitest 2.3.1
Using actionview 4.2.2
Using composite_primary_keys 8.1.2
Using friendly_id 5.1.0
Using paper_trail 4.0.2
An error occurred while installing capybara-webkit (1.10.1), and Bundler cannot
continue.
Make sure that `gem install capybara-webkit -v '1.10.1'` succeeds before
bundling.

Note: I already tried to look into a post with similar problem Cannot install capybara-webkit gem and tried to follow the solution by executing the following command. But got following error.

> qmake -v
'qmake' is not recognized as an internal or external command,
operable program or batch file.
Kessler answered 13/4, 2016 at 20:16 Comment(0)
S
14

Installation instructions are in the capybara-webkit wiki - https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit . You'll want to install Qt 5.5.1 (5.6 is only supported if you build the QtWebKit module separately)

Sayed answered 13/4, 2016 at 20:49 Comment(3)
I've done that (OSX High Sierra) and the gem install still isn't working: "which qmake" => "/usr/local/opt/[email protected]/bin/qmake" but installing the Gem gives me "Command 'qmake ' failed"Craigcraighead
@Craigcraighead That's not the error this question deals with which was Command 'qmake ' not available - so this really isn't the place to ask about it. Open your own question with way more details than you've provided here.Sayed
if you get the error: Error: [email protected]: unknown version :mountain_lion make sure you follow the Note in the documentation: NOTE: If you get Error: [email protected]: unknown version :mountain_lion, comment line #25 in Formula/[email protected]Isentropic
G
13

Ubuntu

sudo apt-get update
sudo apt-get install qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x
Gastrocnemius answered 14/3, 2018 at 10:14 Comment(1)
In Ubuntu 22.04.1 This gives an error: E: Package 'qt5-default' has no installation candidateDorena
S
1

'qmake' is not recognized likely means that Qt is not installed

brew update
cd $( brew --prefix )/Homebrew/Library/Taps/homebrew/homebrew-core
git checkout 9ba3d6ef8891e5c15dbdc9333f857b13711d4e97 Formula/[email protected]
brew install [email protected]
echo 'export PATH="$(brew --prefix [email protected])/bin:$PATH"' >> ~/.bashrc

Complete installation process is here

Swob answered 18/1, 2019 at 10:18 Comment(0)
B
0

I have OS X El Capitan system. I tracked on this link :

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

then

gem install capybara-webkit -- --with-opt-include=/usr/local/bin/qmake

This problem has been solved.

Brogue answered 15/2, 2017 at 4:20 Comment(0)
I
0

I had to run:

QMAKE="$(brew --prefix [email protected])/bin/qmake" gem install capybara-webkit

in order to get the gem to install after I got Error: [email protected]: unknown version :mountain_lion and followed the commenting step from the Homebrew instructions:

NOTE: If you get Error: [email protected]: unknown version :mountain_lion, comment line #25 in Formula/[email protected]

Isentropic answered 28/6, 2019 at 17:8 Comment(0)
J
0

For AltLinux it should be done the following:

  1. As of root install gem-capybara-webkit-devel package:

    # apt-get install gem-capybara-webkit-devel
    
  2. export the PATH's additionals required for the compilation:

    $ export PATH=/usr/share/qt5/bin:$PATH
    
  3. install the gem with bundler

    $ bundle
    
Jentoft answered 19/9, 2019 at 17:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.