0

I searched the whole stackoverflow to get a specific answer on how to successfully install watir, but I failed to install it. I am getting the same error, which I believe others too have got. But I'm not able to resolve it. Can anyone please help me in trouble shooting this issue?

Steps:

Install Ruby - rubyinstaller-1.9.3-p429.exe

Install DevKit (path:C:\DevKit) - DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe (I instaled and tried all the other versions as well)

On cmd:

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

gem version updated to 2.0.3

Install watir:

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

I am getting following error:

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
orde
  • 5,233
  • 6
  • 31
  • 33
  • I think I found the solution to over come the above error. I got the answer from - http://stackoverflow.com/questions/1948043/ruby-cannot-install-watir-gem-on-windows?rq=1. Just do the following- gem install watir --platform=mswin32 (32-bit) gem install watir --platform=mswin64 (64-bit) It should work. Regards, Sanj – user1344631 May 30 '13 at 09:15

1 Answers1

1

Try this

C:\DevKit\gem install watir --system