为capybara-webkit构建本机扩展时出错

时间:2012-10-17 14:28:22

标签: rubygems gem capybara capybara-webkit

我正在尝试在Windows上为capybara安装webkit驱动程序,我收到以下错误:

$ 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

以下是日志文件中的内容:

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

我已经尝试了一段时间来弄清问题是什么。日志文件不是很有帮助,我发现的类似问题的解决方案要么特定于Unix,要么对我不起作用。我很感激你能给我的任何帮助。

注意:此问题已交叉发布到capybara-webkit Google group.


更新:我尝试在the capybara-webkit Google Group的Joe Ferris的推荐下手动构建gem,并设法获得有关导致构建失败的更详细信息。这是我在capybara-webkit目录中执行bundle exec rake build时得到的消息:

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

其他可能相关的信息:

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

我的路径:

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\ 

1 个答案:

答案 0 :(得分:2)

我在这里找到了一个解决方案: https://bugreports.qt-project.org/browse/QTBUG-27237

遵循此特定workaround使其在我的计算机上运行。

它似乎是特定于版本4.8.3的错误,其中找不到正确的rcc.exe路径。

此外,在此之后您可能会遇到与我相同的错误: 事实证明,qmake将webkit服务器编译成 \ capybara-webkit-0.12.1 \ src \ release 。 capybara-webkit builder希望从“debug”文件夹中获取此exe,参见capybara_webkit_builder.rb的第57行

我分叉了git存储库并将此源文件更改为依赖于“release”文件夹,而且它可以工作!

尽管如此,我还是花了2个非常糟糕的变通方法才能使它工作......使用QT 4.7.X可能会更加直接,因为它是capybara-webkit安装程序中的推荐。 我应该测试一下。