Building a Ruby Extension With Win32, Windows XP, in May 2007
Submitted by Kevin Kleinfelter on Fri, 2007-05-25 01:21.
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.
- Download and install Visual C++ 2005 Express Edition (free)
- Download and install the Platform SDK (ISO Edition) from Microsoft.
- I installed none of the 64–bit stuff — mostly just the 32–bit Intel core SDK
- Edit $RUBY_HOME/lib/ruby/1.8/i386-mswin32/config.h and delete the “#error MSC version unmatch” line
- Click your way to:
- Start
- All Programs
- Microsoft Platform SDK…
- Open Build Environment Window
- Windows XP 32–bit Build Environment
- Set Windows XP…(Retail)
- cd "C:\Program Files\Microsoft Visual Studio 8\VC\bin"
- The quotes are important.
- vcvars32.bat
- cd C:\temp\guitest\ext\cguitest
- I'm building the guitest extension
- ruby extconf.rb
- nmake
- 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'
- nmake install
- cd \temp\guitest
- ruby install.rb install
- irb
- require 'win32/guitest'
- Happiness

Delicious
Digg
Reddit
I hit a snag
Working with guitest020218.tar.gz from:
http://raa.ruby-lang.org/project/win32-guitest/
On Windows XP , ruby 1.8.5 , VS 2005
Things go smoothly until item 10.
On item 10:
I do not see a my_test.so anywhere should it be cguitest.so for this
example?
On item 13: Seems something is missing from the command....
> ruby install.rb install
install.rb config first
try 'ruby install.rb --help' for usage
Thanks for the how-to. Please let me know if you
know where I went off track.
Thanks!