When I Googled for building Ruby extensions for Windows, I found a lot of old (very old) information. I found some good info at this web site. What follows is a record of my attempts to follow this guidance.

  1. Download and install Visual C++ 2005 Express Edition (free)
  2. Download and install the Platform SDK (ISO Edition) from Microsoft.
    1. I installed none of the 64–bit stuff — mostly just the 32–bit Intel core SDK
  3. Edit $RUBY_HOME/lib/ruby/1.8/i386-mswin32/config.h and delete the “#error MSC version unmatch” line
  4. Click your way to:
    • Start
    • All Programs
    • Microsoft Platform SDK…
    • Open Build Environment Window
    • Windows XP 32–bit Build Environment
    • Set Windows XP…(Retail)
  5. cd "C:\Program Files\Microsoft Visual Studio 8\VC\bin"
    • The quotes are important.
  6. vcvars32.bat
  7. cd C:\temp\guitest\ext\cguitest
    • I'm building the guitest extension
  8. ruby extconf.rb
  9. nmake
  10. mt.exe -manifest my_test.so.manifest -outputresource:my_test.so;2
    • Copy and paste the command above. You need it all from the 'mt' to the ';2'
  11. nmake install
  12. cd \temp\guitest
  13. ruby install.rb install
  14. irb
    • require 'win32/guitest'
  15. Happiness