4

I'm trying to install the webkit driver for capybara on Windows, and I'm getting the following error:

$ gem install capybara-webkit-0.12.1.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing capybara-webkit-0.12.1.gem:
        ERROR: Failed to build gem native extension.

        c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb


Gem files will remain installed in c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.12.1 for inspection.
Results logged to c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.12.1/./gem_make.out

And here's what's in the log file:

C:\>cat c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.12.1/./gem_make.out
c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb

I've been trying for some time now to figure out what the problem is. The log file isn't very helpful, and the solutions to similar problems that I found were either specific to Unix or and didn't work for me. I'd appreciate any help you can give me.

Note: This question has been cross-posted to the capybara-webkit Google group.


Update: I tried building the gem manually on the recommendation of Joe Ferris on the capybara-webkit Google Group, and managed to get some more detailed information on what's causing the build to fail. Here's the message I get while executing bundle exec rake build in capybara-webkit's directory:

cd src/ && c:/Qt/4.8.3/bin/qmake.exe "c:/Documents and Settings/user/My Documents/Workspace/thoughtbot-capybara-webkit-7289a8e/src/webkit_server.pro" -spec c:/Qt/4.8.3/mkspecs/win32-g++ -o Makefile.webkit_server
'.' is not recognized as an internal or external command,
operable program or batch file.
'.' is not recognized as an internal or external command,
operable program or batch file.
capybara-webkit 0.12.0 built to pkg/capybara-webkit-0.12.0.gem
cd src/ && make -f Makefile.webkit_server 
make[1]: Entering directory `/c/Documents and Settings/user/My Documents/Workspace/thoughtbot-capybara-webkit-7289a8e/src'
make -f Makefile.webkit_server.Release
make[2]: Entering directory `/c/Documents and Settings/user/My Documents/Workspace/thoughtbot-capybara-webkit-7289a8e/src'
bin/rcc.exe -name webkit_server webkit_server.qrc -o release/qrc_webkit_server.cpp
make[2]: bin/rcc.exe: Command not found
make[2]: *** [release/qrc_webkit_server.cpp] Error 127
make[2]: Leaving directory `/c/Documents and Settings/user/My Documents/Workspace/thoughtbot-capybara-webkit-7289a8e/src'
make[1]: *** [release] Error 2
make[1]: Leaving directory `/c/Documents and Settings/user/My Documents/Workspace/thoughtbot-capybara-webkit-7289a8e/src'
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2
Command 'make' failed

Other potentially relevant information:

C:\>which make --all
C:\RailsInstaller\DevKit\bin\make.EXE
C:\Qt\4.8.3\bin\make.BAT
C:\Program Files\Gow\bin\make.EXE
C:\>which rcc
C:\Qt\4.8.3\bin\rcc.EXE
C:\>which g++
C:\RailsInstaller\DevKit\mingw\bin\g++.EXE

And my PATH:

C:\PROGRA~1\Serena\vm\win32\bin;
C:\PROGRA~1\Serena\vm\common\bin\win32;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\Program Files\ATI Technologies\ATI.ACE\;
C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;
C:\WINDOWS\system32\WindowsPowerShell\v1.0;
C:\Program Files\TortoiseSVN\bin;
C:\RailsInstaller\Ruby1.9.3\bin;
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\bin;
C:\RailsInstaller\DevKit\bin;
C:\RailsInstaller\Git\cmd;
C:\Program Files\ansi153\x86;
C:\bin;
C:\RailsInstaller\DevKit\mingw\bin;
C:\Qt\4.8.3\bin;
C:\Program Files\Nodejs;
C:\Documents and Settings\user\Desktop\emacs-23.4\bin;
C:\Python27;
C:\Python27\Scripts;
C:\Program Files\GnuWin32\bin;
C:\Program Files\Gow\bin;
C:\Program Files\Notepad++;
C:\Documents and Settings\user\Application Data\npm\ 
3

1 Answer 1

2

I found a solution here : https://bugreports.qt-project.org/browse/QTBUG-27237

Following this specific workaround make it work on my computer.

It seems to be a bug specific to version 4.8.3, where rcc.exe path is not found correctly.

Also, you might encounter the same error as me after this: It turns out qmake compiled the webkit server into \capybara-webkit-0.12.1\src\release. And capybara-webkit builder expect to get this exe from the "debug" folder, see line 57 of capybara_webkit_builder.rb

I forked the git repository and change this source file to rely on "release" folder instead and it works!

Still, it took me 2 pretty bad workarounds to make it work... Maybe the installation is more straightforward using QT 4.7.X as recommended into the capybara-webkit installation procedure. I should test it.

6
  • Yes, it appears we both had the exact same problem. (With the script looking in \src\debug and everything.) My workaround was to manually run through the build process in IRB, correcting the errors in the makefiles and path_to_binary as I went.
    – Ajedi32
    Oct 31, 2012 at 19:38
  • Oh, and if you do test QT 4.7.X, please let me know whether it works for you.
    – Ajedi32
    Oct 31, 2012 at 19:39
  • hmmm, your way of doing sure wasn't easy either, but you can rely on the webkit official release this way. I'll try with QT 4.7 next week, I'll let you know!
    – Saaman
    Oct 31, 2012 at 20:15
  • By the way, what OS are you running? I'm curious to know whether this problem occurs with QT 4.8.3 on all operating systems or just Windows or Windows XP (which is what I am using).
    – Ajedi32
    Nov 2, 2012 at 13:37
  • I'm on Windows 7. Also, I tested with QT 4.7.4. The compilation went great, except that it published the webkit_server.exe into 'release' whereas webkit builder expect to have it in 'debug'. I'm not sure, but I don't see why the webkit would expect a debug version.
    – Saaman
    Nov 5, 2012 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.