Ruby: Cannot Install Watir Gem On Windows
Question
Watir's site says I need Ruby 1.8.6, which I'm running. And windows installation should be as simple as gem install watir
. But when I run that, I get this:
C:\Users\Ryguy\Code>gem install watir
Building native extensions. This could take a while...
ERROR: Error installing watir:
ERROR: Failed to build gem native extension.
C:/Ruby/bin/ruby.exe extconf.rb
checking for strncpy_s()... no
creating Makefile
make
'make' is not recognized as an internal or external command,
operable program or batch file.
Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/win32-api-1.4.5 f
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/win32-api-1.4.5/ext/gem_make.out
My Ruby Version: ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]
My RubyGems Version: 1.3.5
Solution
I would recommend you install the RubyInstaller Development Kit as documented here
Once you've installed it, the compile process of Watir dependencies (win32-api) will install successfully.
OTHER TIPS
Turns out I needed to install the Ruby Development files. =/
Execute Below command and its works
gem install watir --platform=mswin32
Installed devkit and after calling the bat file on Windows 7 from a cmd it fixed this issue. Using Ruby 1.9.1
I also had to install nokogiri to get Watir to install successfully on windows, after installing DevKit. Use: gem install nokogiri