Ruby(RoR) Tip4: Install rcov on Windows

Balaji D Loganathan

43 sec read

If you are one of the victim who got the below error on your Windows machine…
[source language=”xml”]
Building native extensions. This could take a while…
ERROR: Error installing rcov:
ERROR: Failed to build gem native extension.
F:/–ruby install path–/Ruby/bin/ruby.exe extconf.rb
creating Makefile
nmake
‘nmake’ is not recognized as an internal or external command,
operable program or batch file.
Gem files will remain installed in F:/–ruby install path–/Ruby/lib/ruby/gems/1.8/ge
ms/rcov-0.9.8 for inspection.
Results logged to F:/–ruby install path–/Ruby/lib/ruby/gems/1.8/gems/rcov-0.9.8/ext
/rcovrt/gem_make.out
[/source]
the I have a suggestion.

The solution is pretty simple:
Install the MinGW version of Ruby from http://rubyinstaller.org/. You might still face the nmake problem, in such case install the Development Kit from http://rubyinstaller.org/downloads/
The other side:
If you don’t want to move towards MinGW version but still want to use mswin32 version plus rcov, then the solution is bit time consuming but doable. You have to use MS Visual Studio Tools for compiling the Ruby source code. See the steps here http://madcoderspeak.blogspot.com/2009/06/how-to-compile-ruby-from-source-on.html, after that installing rcov might work.

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *