构建capybara-webkit的本机扩展时出错 [英] Error while building native extensions for capybara-webkit

查看:200
本文介绍了构建capybara-webkit的本机扩展时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我试图在Windows上安装capybara的webkit驱动程序,并且出现以下错误: $ gem install capybara-webkit-0.12.1.gem 
暂时增强PATH以包含DevKit ...
构建本机扩展。这可能需要一段时间...
错误:安装capybara-webkit-0.12.1.gem时出错:
错误:无法构建gem原生扩展。

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


Gem文件将保持安装在c:/RailsInstaller/Ruby1.9.3 /lib/ruby/gems/1.9.1/gems/capybara-webkit-0.12.1进行检查。
记录到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。




更新:我尝试根据Joe Ferris的建议手动构建宝石 capybara-webkit Google Group ,并设法获得关于导致构建失败的更多详细信息。以下是我在capybara-webkit目录中执行 bundle exec rake build 时得到的消息:

  cd src /&& c:/Qt/4.8.3/bin/qmake.exec:/ Documents and Settings / user / My Documents / Workspace / thinkbot-capybara-webkit-7289a8e / src / webkit_server.pro-spec c:/ Qt / 4.8.3 / mkspecs / win32-g ++ -o Makefile.webkit_server 
'。'不被识别为内部或外部命令,
可操作的程序或批处理文件。
'。'不被识别为内部或外部命令,
可操作程序或批处理文件。
capybara-webkit 0.12.0内置于pkg / capybara-webkit-0.12.0.gem
cd src /&& make -f Makefile.webkit_server $ b $ make [1]:进入目录`/ c / Documents and Settings / user / My Documents / Workspace / thinkbot-capybara-webkit-7289a8e / src'
make -f Makefile .webkit_server.Release
make [2]:进入目录`/ c / Documents and Settings / user / My Documents / Workspace / thinkbot-capybara-webkit-7289a8e / src'
bin / rcc.exe - name webkit_server webkit_server.qrc -o release / qrc_webkit_server.cpp
make [2]:bin / rcc.exe:未找到命令
make [2]:*** [release / qrc_webkit_server.cpp]错误$ b $ make [2]:离开目录`/ c / Documents and Settings / user / My Documents / Workspace / thinkbot-capybara-webkit-7289a8e / src'
make [1]:*** [发布]错误2
make [1]:离开目录`/ c / Documents and Settings / user / My Documents / Workspace / thinkbot-capybara-webkit-7289a8e / src'
make:*** [错误2
命令'make'失败



<其他潜在的相关信息:

  C:\>它使得--all 
C:\RailsInstaller\DevKit\bin \make.EXE
C:\ Qt\4.8.3\bin\make.BAT
C:\ Program Files \Gow\bin\make.EXE
C:\>其中rcc
C:\ Qt\4.8.3\bin\rcc.EXE
C:\>其中g ++
C: \RailsInstaller\DevKit\mingw\bin\g ++ .EXE

我的PATH:

  C:\PROGRA〜1 \ Serena \vm\win32\bin; 
C:\PROGRA〜1 \ Serena \vm\common\bin\win32;
C:\WINDOWS\system32;
C:\ WINDINDOWS;
C:\WINDOWS\System32\Wbem;
C:\ Program Files \ATI Technologies\ATI.ACE\;
C:\程序文件\微软SQL Server\80\Tools\Binn\;
C:\WINDOWS\system32\WindowsPowerShell\v1.0;
C:\程序文件\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:\程序文件\节点;
C:\ Documents and Settings \ user\Desktop\emacs-23.4\bin;
C:\Python27;
C:\Python27\Scripts;
C:\程序文件\GnuWin32\bin;
C:\ Program Files \Gow\bin;
C:\程序文件\Notepad ++;
C:\ Documents and Settings\user\Application Data\\\
pm\


解决方案

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



继这个特定的解决方法使它在我的计算机上工作。



它似乎是4.8.3版特有的错误,其中rcc.exe路径找不到。



另外,在此之后,您可能会遇到和我一样的错误:
事实证明,qmake将webkit服务器编译为 \ capybara-webkit-0.12.1 \ src\release
并且capybara-webkit构建器希望从debug文件夹中获得该exe文件,请参阅 capybara_webkit_builder.rb


我分叉了git存储库并改变了这个源文件来依赖ease文件夹它的工作原理!

然而,我花了两个相当糟糕的解决方法,使它工作...也许安装更直接使用QT 4.7.X推荐到capybara-webkit安装程序。
我应该测试它。


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\ 

解决方案

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.

这篇关于构建capybara-webkit的本机扩展时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆