我正在尝试运行需要“capybara-webkit”宝石的Rails应用程序。我已经安装了0.12.1版但是应用程序要求0.10.1。我无法让它工作,即使我确信其他一切都已安装。我想知道路径或Qt版本是不兼容还是不正确?
当我尝试安装gem时,我收到以下错误消息:
错误:(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
我确信我安装了正确的软件(如下所示)。
运行:
Windows 7(64位) Ruby 1.9.3 Rails 3.2.6 QT 4.8.2 DevKit 32 4.5.2
红宝石:
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
环境路径:
用户:
;%HOMEDRIVE%\机器人\ SDK \工具; C:\ RUBY \ RailsInstaller \ Ruby1.9.3 \ BIN; C:\ RUBY \ RailsInstaller \的devkit \ BIN; C:\ RUBY \ QT \ BIN
系统:
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
答案 0 :(得分:0)
确保已安装Qt v4.7.4 w/ support for mingw32并将Qt的bin目录添加到PATH。在安装期间,当询问MinGW路径时,请选择Ruby193\devkit\mingw
目录。
之前我遇到过同样的问题,这是我找到的最快的解决方案。
较新版本的Qt仍然存在与Windows的兼容性问题。但是,如果您决定尝试一下,请查看Error while building native extensions for capybara-webkit。
答案 1 :(得分:0)
您尚未向环境添加mingw路径,因此构建过程无法正常工作。您必须遵循https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit并正确获取所有依赖项版本。