2
votes

I am trying to run a Rails app that requires the "capybara-webkit" gem. I already have version 0.12.1 installed however application is asking for 0.10.1. I just cannot get it to work, even though I am sure everything else is installed. I wonder if path or Qt version is incompatible or incorrect?

When I attempt to install the gem I get the following error message:

Error: (gem install capybara-webkit -v '0.10.1')

   Installing capybara-webkit (0.10.1) with native extensions 
 Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

     C:/RUBY/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb 


 Gem files will remain installed in 

 C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.10.1 for 

 inspection.
 Results logged to C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/capybara-

 webkit-0.10.1/./gem_make.out

gem_make.out:

   C:/RUBY/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb

extconf.rb:

   require File.join(File.expand_path(File.dirname(__FILE__)), "lib","capybara_webkit_builder")
 CapybaraWebkitBuilder.build_all

I am sure I have the correct software installed (as below).

Running:

Windows 7 (64 bit) Ruby 1.9.3 Rails 3.2.6 QT 4.8.2 DevKit 32 4.5.2

Ruby:

 RUBYGEMS VERSION: 1.8.16
 RUBY VERSION: 1.9.3 (2012-02-16 patchlevel 125) [i386-mingw32]
 INSTALLATION DIRECTORY: C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1
 RUBY EXECUTABLE: C:/RUBY/RailsInstaller/Ruby1.9.3/bin/ruby.exe
 EXECUTABLE DIRECTORY: C:/RUBY/RailsInstaller/Ruby1.9.3/bin
 RUBYGEMS PLATFORMS:
   ruby
   x86-mingw32
 GEM PATHS:
    C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1
    C:/Users/COMPAQ/.gem/ruby/1.9.1
 GEM CONFIGURATION:
    :update_sources => true
    :verbose => true
    :benchmark => false
    :backtrace => false
    :bulk_threshold => 1000
 REMOTE SOURCES:
    http://rubygems.org/
 ----------------------
 IDE: JetBrains RubyMine 4.0.3, build #RM-117.230
 OS: Windows 7 6.1[x86]
 Java: 1.6.0_29-b11
 RubyMine SDK Environment:
 Sdk: ruby-1.9.3-p125
 Sdk Version: ver.1.9.3p125 p125
 Ruby Interpreter: C:/RUBY/RailsInstaller/Ruby1.9.3/bin/ruby.exe
 RVM Sdk: no
 Sdk Language Level: 1.9
 Sdk Load Path:
      C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1
      C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/i386-msvcrt
      C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby
      C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/vendor_ruby/1.9.1
      C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/vendor_ruby/1.9.1/i386-msvcrt
      C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/vendor_ruby
      C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1
      C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/i386-mingw32
      C:/Program Files (x86)/JetBrains/RubyMine 4.0.2/rubystubs19
 Sdk Gem paths: 
      C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems
      C:/Users/COMPAQ/.gem/ruby/1.9.1/gems
      C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems
      C:/Users/COMPAQ/.gem/ruby/1.9.1/bundler/gems

Environment Paths:

User:

;%HOMEDRIVE%\ANDROID\SDK\tools;C:\RUBY\RailsInstaller\Ruby1.9.3\bin;C:\RUBY\RailsInstaller\DevKit\bin;C:\RUBY\QT\bin

System:

C:\RUBY\RailsInstaller\Git\cmd;C:\RUBY\RailsInstaller\Ruby1.9.3\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Teleca Shared;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem\;C:\RUBY\RailsInstaller\Git\bin;C:\RUBY\QT\bin

2
What is the output of gem install capybara-webkit -v '0.10.1'? - Justin ᚅᚔᚈᚄᚒᚔ
gem install... produces the same error as above. - dmuk
Have you inspected the contents of C:/RUBY/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.10.1/gem_make.out? What I'm getting at is, somewhere it has logged why the compile failed, not just that it did. - Justin ᚅᚔᚈᚄᚒᚔ

2 Answers

0
votes

Make sure you have Qt v4.7.4 w/ support for mingw32 installed and Qt's bin directory added to PATH. During instalation, choose your Ruby193\devkit\mingw directory when asked about MinGW path.

I came across that very same problem before and this was the quickest solution I found.

Newer versions of Qt still have compatibility issues with Windows. However, if you decide to give it a try, take a look at Error while building native extensions for capybara-webkit.

0
votes

You haven't added the mingw path to your environment, so the build process cannot work. You have to follow https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit and get all your dependency versions right.