preload
A Unix ‘Which’ command for Windows A RSpec output web server
Jan 15

Lucky me I got a new computer this week, and of course it comes with Windows 7. So I was installing all my development tools — Ruby and Watir among others — and ran into this problem:

C:\Users\John\Dev>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 for inspection.
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/win32-api-1.4.5/ext/gem_make.out

C:\Users\John\Dev>

Hmm… Thats not good. Looking around on the Internet, I found that there was a devkit that had all the tools I would need to install Gems that required compiling native extensions. Once I installed all the tools as directed on the website, everything worked great:

C:\Users\John\Dev>gem install watir
Building native extensions.  This could take a while...

========================================================================

           Thanks for installing Gemcutter! You can now run:

    gem push          publish your gems for the world to use and enjoy
    gem owner         allow/disallow others to push to your gems
    gem webhook       register urls to be pinged when gems are pushed

========================================================================

Successfully installed win32-api-1.4.5
Successfully installed windows-api-0.4.0
Successfully installed windows-pr-1.0.8
Successfully installed win32-process-0.6.2
Successfully installed xml-simple-1.0.12
Successfully installed json_pure-1.2.0
Successfully installed rubyforge-2.0.3
Successfully installed gemcutter-0.3.0
Successfully installed hoe-2.5.0
Successfully installed s4t-utils-1.0.4
Successfully installed builder-2.1.2
Successfully installed user-choices-1.1.6
Successfully installed commonwatir-1.6.5
Successfully installed firewatir-1.6.5
Successfully installed nokogiri-1.4.1-x86-mingw32
Successfully installed watir-1.6.5
16 gems installed
Installing ri documentation for win32-api-1.4.5...
Installing ri documentation for windows-api-0.4.0...
Installing ri documentation for windows-pr-1.0.8...
Installing ri documentation for win32-process-0.6.2...
Installing ri documentation for xml-simple-1.0.12...
Installing ri documentation for json_pure-1.2.0...
Installing ri documentation for rubyforge-2.0.3...
Installing ri documentation for gemcutter-0.3.0...
Installing ri documentation for hoe-2.5.0...
Installing ri documentation for s4t-utils-1.0.4...
Installing ri documentation for builder-2.1.2...
ERROR:  While generating documentation for builder-2.1.2
... MESSAGE:   Unhandled special: Special: type=17, text="<!-- HI -->"
... RDOC args: --ri --op C:/Ruby/lib/ruby/gems/1.8/doc/builder-2.1.2/ri --title Builder -- Easy XML Building --main
README --line-numbers --quiet lib CHANGES Rakefile README doc/releases/builder-1.2.4.rdoc doc/releases/builder-2.0.0
.rdoc doc/releases/builder-2.1.1.rdoc --title builder-2.1.2 Documentation
(continuing with the rest of the installation)
Installing ri documentation for user-choices-1.1.6...
Installing ri documentation for commonwatir-1.6.5...
Installing ri documentation for firewatir-1.6.5...
Installing ri documentation for nokogiri-1.4.1-x86-mingw32...
...
Installing ri documentation for watir-1.6.5...
Installing RDoc documentation for win32-api-1.4.5...
Installing RDoc documentation for windows-api-0.4.0...
Installing RDoc documentation for windows-pr-1.0.8...
Installing RDoc documentation for win32-process-0.6.2...
Installing RDoc documentation for xml-simple-1.0.12...
Installing RDoc documentation for json_pure-1.2.0...
Installing RDoc documentation for rubyforge-2.0.3...
Installing RDoc documentation for gemcutter-0.3.0...
Installing RDoc documentation for hoe-2.5.0...
Installing RDoc documentation for s4t-utils-1.0.4...
Installing RDoc documentation for builder-2.1.2...
Installing RDoc documentation for user-choices-1.1.6...
Installing RDoc documentation for commonwatir-1.6.5...
Installing RDoc documentation for firewatir-1.6.5...
Installing RDoc documentation for nokogiri-1.4.1-x86-mingw32...
...
Installing RDoc documentation for watir-1.6.5...

I was thinking it was going to be a real bear to get it all installed, but with this devkit, it was a breeze!

SociBook del.icio.us Digg Facebook Google Yahoo Buzz StumbleUpon

One Response to “Installing the Watir Gem under Windows 7”

  1. David Says:

    A good option for installing Ruby w/ the dev kit headers (needed for some gems) is to use the Rails Installer from 37 labs.

Leave a Reply