2013-05-29 60 views
0

我搜索了整個stackoverflow,以獲得關於如何成功安裝watir的特定答案,但是我未能安裝它。我遇到了同樣的錯誤,我相信其他人也得到了這個錯誤。但我無法解決它。任何人都可以請幫我解決這個問題嗎?在windows 7上安裝watir gem的錯誤

步驟:

安裝Ruby - ruby​​installer-1.9.3-p429.exe

安裝的devkit(路徑:C:\的devkit) - 的devkit-TDM-32-4.5.2-20111229-1559 -sfx.exe(我instaled並嘗試了所有的其他版本)中

在CMD:

C:\DevKit\ruby dk.rb init 
C:\DevKit\ruby dk.rb install 
C:\DevKit\gem update --system 

寶石版本更新至2.0.3

安裝的Watir:

C:\DevKit\gem install watir --no-ri --no-rdoc 

我收到以下錯誤:

Temporarily enhancing PATH to include DevKit... 
Building native extensions. This could take a while... 
The system cannot find the path specified. 
ERROR: Error installing watir: 
     ERROR: Failed to build gem native extension. 

    C:/Ruby193/bin/ruby.exe extconf.rb 
checking for libxml/parser.h... *** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of 
necessary libraries and/or headers. Check the mkmf.log file for more 
details. You may need configuration options. 

Provided configuration options: 
     --with-opt-dir 
     --without-opt-dir 
     --with-opt-include 
     --without-opt-include=${opt-dir}/include 
     --with-opt-lib 
     --without-opt-lib=${opt-dir}/lib 
     --with-make-prog 
     --without-make-prog 
     --srcdir=. 
     --curdir 
     --ruby=C:/Ruby193/bin/ruby 
     --with-zlib-dir 
     --without-zlib-dir 
     --with-zlib-include 
     --without-zlib-include=${zlib-dir}/include 
     --with-zlib-lib 
     --without-zlib-lib=${zlib-dir}/lib 
     --with-iconv-dir 
     --without-iconv-dir 
     --with-iconv-include 
     --without-iconv-include=${iconv-dir}/include 
     --with-iconv-lib 
     --without-iconv-lib=${iconv-dir}/lib 
     --with-xml2-dir 
     --without-xml2-dir 
     --with-xml2-include 
     --without-xml2-include=${xml2-dir}/include 
     --with-xml2-lib 
     --without-xml2-lib=${xml2-dir}/lib 
     --with-xslt-dir 
     --without-xslt-dir 
     --with-xslt-include 
     --without-xslt-include=${xslt-dir}/include 
     --with-xslt-lib 
     --without-xslt-lib=${xslt-dir}/lib 
     --with-libxslt-config 
     --without-libxslt-config 
     --with-pkg-config 
     --without-pkg-config 
     --with-libxml-2.0-config 
     --without-libxml-2.0-config 
     --with-pkg-config 
     --without-pkg-config 
     --with-libiconv-config 
     --without-libiconv-config 
     --with-pkg-config 
     --without-pkg-config 
C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to genera 
te an executable file. (RuntimeError) 
You have to install development tools first. 
     from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp' 
     from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header' 
     from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' 
     from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postp 
one' 
     from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
     from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' 
     from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
     from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' 
     from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' 
     from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:969:in `find_header' 
     from extconf.rb:166:in `<main>' 


Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/nokogiri- 
1.6.0.rc1 for inspection. 
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.0.rc1/ext/nok 
ogiri/gem_make.out 
+0

我想我找到了解決方案,在來到上述錯誤。我得到了答案 - http://stackoverflow.com/questions/1948043/ruby-cannot-install-watir-gem-on-windows?rq=1。只需執行以下操作 - gem install watir --platform = mswin32(32位) gem install watir --platform = mswin64(64位) 它應該可以工作。問候,桑傑 – user1344631

回答

1

試試這個

C:\DevKit\gem install watir --system