我搜索了整个stackoverflow以获得关于如何成功安装watir的具体答案,但我未能安装它。我也犯了同样的错误,我相信其他人也犯过同样的错误。但我解决不了。有人能帮我解决这个问题吗?
步骤:
安装Ruby - rubyinstaller-1.9.3-p429.exe
安装DevKit(路径:C:DevKit) - DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe(我安装并尝试了所有其他版本)
在cmd:C:DevKitruby dk.rb init
C:DevKitruby dk.rb install
C:DevKitgem update --system
gem版本更新到2.0.3
安装watir都:C:DevKitgem 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
试试这个
C:DevKitgem install watir --system