# How to compile Ruby on Windows

**URL:** <https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959>\
**Category:** Ruby\
**Created:** [March 15, 2006, 3:25pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959 "2006-03-15T15:25:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 3:25pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/1 "2006-03-15T15:25:08Z")

</div>

Does anybody have a kind of “step by step” instructions on how to  
compile Ruby on Windows? (I don’t need the one click installer). I have  
VC+ 2003 toolkit and .net 1.1 sdk but I’m not really sure how to get the  
.exe release out of the source. I’ve read the other threads but none of  
them really explain how to complile it.

Thank you in advance. AlphaBeta

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 3:39pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/2 "2006-03-15T15:39:13Z")

</div>

I’ve been down this path but had a few problems and gave up.  
Basically I could do it with Visual Studio 6 but failed with vc2003. My  
main problem after this though was that while I got it to compile under  
VS6,  
I then couldn’t use RUDL (separate package) because it complained about  
“require\_\_” when I tried to start my app.

It does kind of back up one of my issues which I’ve raised before, that  
Windows (which so many people use) doesn’t have an “official” release  
for  
Windows, and we are dependant on Curt’s (very fine) work to provide the  
one-click-installer. Which quite understandably he does in his spare  
time.

A proper, official, supported “how-to” with the correct  
build-environment  
configs, versions of tools (MAKE, LIB etc.) and so on would be great.  
That  
way we could at least all be “singing from the same sheet”.

Glenn  
(wearing a flameproof suit!)

On 15/03/06, AlphaBeta [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

–

All the best  
Glenn  
Aylesbury, UK

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 4:44pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/3 "2006-03-15T16:44:47Z")

</div>

Glenn S. schrieb:

> A proper, official, supported “how-to” with the correct build-environment  
> configs, versions of tools (MAKE, LIB etc.) and so on would be great. That  
> way we could at least all be “singing from the same sheet”.

+1 But I suggest a ruby-dev list in english, as my japanese is very poor  
😉 The summaries are fine but they don’t provide any further help. If I  
had an english discussion list, I properbly able to collect the  
information I need. So the chance that someone writes a tutorial or  
HOWTO will increase.

g,

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 6:10pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/4 "2006-03-15T18:10:07Z")

</div>

On 3/15/06, Daniel Völkerts [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> HOWTO will increase.

Download and install the following:

1. Visual C++ Toolkit 2003 (free)  
[Microsoft Learn: Build skills that open doors in your career](http://msdn.microsoft.com/visualc/vctoolkit2003/)

2. MS Platform SDK 2003 (free. Uncheck everything but the “Core”  
entry. You want everything under Core, even if you don’t have a 64bit  
machine. Some of the important tools are only part of the 64bit  
section.)  
[http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en](http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en)

3. MS .NET Framework 1.1 (a prerequisite for #4)  
[http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3&displaylang=en](http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3&displaylang=en)

4. MS .NET SDK 1.1 (not 2.0.)  
[http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d&displaylang=en](http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d&displaylang=en)

Once you’ve downloaded and installed these, you’ll need to configure  
your environment variables. Here’s what my vcvars32.bat file looks  
like: (Sorry about the line breaks. You’ll need to remove those.)

@echo off  
Set PATH=C:\Program Files\Microsoft Visual C++ Toolkit  
2003\bin;C:\Program Files\Microsoft Platform SDK\Bin;C:\Program  
Files\Microsoft Platform SDK\Bin\win64\x86\AMD64;%PATH%  
Set INCLUDE=C:\Program Files\Microsoft Visual C++ Toolkit  
2003\include;C:\Program Files\Microsoft Platform  
SDK\Include;C:\Program Files\Microsoft Visual Studio .NET  
2003\Vc7\include;%INCLUDE%  
Set LIB=C:\Program Files\Microsoft Visual C++ Toolkit  
2003\lib;C:\Program Files\Microsoft Platform SDK\Lib;C:\Program  
Files\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB%

Those should be the default installation folders for the Microsoft  
tools, but if you put them elsewhere, simply modify the batch file to  
suit. Note that you need the AMD64 tools in your path even if you  
have a 32bit machine. For some crazy reason, that’s where Microsoft  
put some of the important tools.

Download the latest Ruby release from:  
[http://www.ruby-lang.org/en/20020102.html](http://www.ruby-lang.org/en/20020102.html)  
You can either get the 1.8.4 release, or the ‘stable snapshot’, which  
includes fixes since the last release. The first time you try to get  
this working, I recommend the regular release.

Uncompress the download into a folder that doesn’t have any spaces in  
the name.  
For the purposes of this howto, let’s say that’s c:\ruby-src  
If I explained myself clearly, you will now have a folder called  
c:\ruby-src\ruby-1.8.4, with various things under it, including  
c:\ruby-src\ruby-1.8.4\win32  
If you download a different release than 1.8.4, that folder name might  
be different.

To avoid cluttering up this directory with temporary files, we’ll do  
the actual build elsewhere.  
Make a folder called c:\ruby-src\build\

Open a command prompt by clicking a shortcut, or typing “cmd” into the  
Start → Run prompt.  
Run the “vcvars32.bat” file you made earlier, which will add the  
Microsoft tools to your environment. This means, by the way, that it  
should be somewhere in your default PATH.

==== SCARY HACK SECTION ====  
The Microsoft tools previously included a pair of utilities, “lib” and  
“dumpbin”, which acted as front-ends for the “link.exe” command.  
Luckily, the 64bit directory in the Platform SDK includes “lib.exe”,  
but we still need to deal with dumpbin.exe. Sadly, none of the free  
downloads seem to include it.  
Ruby 1.9/2.0 shouldn’t have this problem, and you can skip this step  
if you have the full Visual Studio 2003.

Go to c:\ruby-src\ruby-1.8.4\win32, and edit the following file:  
mkexports.rb  
On line 6, change the command inside the double-quotes of IO.foreach.  
change: "|dumpbin -symbols "  
to: "|link /dump /symbols "  
Don’t forget the space at the end.  
==== END SCARY HACK ====

Change your current directory to c:\ruby-src\build  
Run the following commands, in order:  
c:\ruby-src\ruby-1.8.4\win32\configure.bat (yes, you need to refer to  
it by its full path.)  
nmake  
nmake test  
nmake DESTDIR=c:/ruby install  
The final command allows you to specify where you actually want Ruby  
to be installed.  
Note the forward slash instead of backslash.  
There are more examples in the README.win32 file, found in the  
c:\ruby-src\ruby-1.8.4\win32\ folder.

So simple, even a child could operate it!

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 8:21pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/5 "2006-03-15T20:21:59Z")

</div>

Blimey!

And on Linux? ./configure; make; sudo make install

:o)

I accept that you know what you are talking about Wilson, but surely  
there  
is a much easier way? And bear in mind that what we are wanting to  
achieve  
here is a compile-on-windows FAQ that is standard so that all of the  
various  
ruby libraries will also work.

Is there no single-downloadable compiler that will compile, link and  
install  
(ie. provider compiler, linker and make tool) that will provide good  
executables with reasonable performance and minimal hassle?

Glenn

On 15/03/06, Wilson B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > +1 But I suggest a ruby-dev list in english, as my japanese is very poor
> 
> 1. MS Platform SDK 2003 (free. Uncheck everything but the “Core”
> 2. MS .NET SDK 1.1 (not 2.0.)  
> Files\Microsoft Platform SDK\Bin\win64\x86\AMD64;%PATH%  
> suit. Note that you need the AMD64 tools in your path even if you  
> name.
> 
> but we still need to deal with dumpbin.exe. Sadly, none of the free  
> ==== END SCARY HACK ====  
> Note the forward slash instead of backslash.  
> There are more examples in the README.win32 file, found in the  
> c:\ruby-src\ruby-1.8.4\win32\ folder.
> 
> So simple, even a child could operate it!

–

All the best  
Glenn  
Aylesbury, UK

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 8:59pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/6 "2006-03-15T20:59:26Z")

</div>

On 3/15/06, Glenn S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is there no single-downloadable compiler that will compile, link and install  
> (ie. provider compiler, linker and make tool) that will provide good  
> executables with reasonable performance and minimal hassle?

No. Of the choices, MSYS/MINGW is going to work most like Unix. MSVC6  
is no longer available for legal download. But…

[VS.NET](http://VS.NET) (2002 & 2003) & VS (2005) use a later MSVC runtime DLL (7, 7.1,  
and 8.0) that are different than the MSVC6 runtime DLL. The MSVC8 DLL  
is significantly different even than [VS.NET](http://VS.NET) (7, 7.1).

I am also working, in fits and starts, on compile instructions for cl  
14 (VS 2005) with the currently-free Express version. This will be  
something that ultimately can go through the entire Ruby build process  
and build something like the one-click installer for you.

-austin

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 9:27pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/7 "2006-03-15T21:27:45Z")

</div>

On 3/15/06, gregarican [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I am also working, in fits and starts, on compile instructions for cl  
> > a no-brainer for sure 🙂  
> > Did I say “instructions?”

This will also include batch files to do certain things.

Most things, in fact. Since the VS 2005 builds require patches on  
almost everything.

-austin

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 9:21pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/8 "2006-03-15T21:21:29Z")

</div>

Austin Z. wrote:

> something that ultimately can go through the entire Ruby build process  
> and build something like the one-click installer for you.
> 
> -austin

This sounds pretty complicated as a DIY solution or a project goal. I  
certainly applaud your efforts in accomplishing this. Seeing that  
Microsoft’s runtime distros are a moving target it doesn’t appear to be  
a no-brainer for sure 🙂

While exploring other programming languages I downloaded EiffelStudio  
for Windows last month. This took awhile to download and certainly took  
awhile to build, but the process was automated and required little  
interaction on the enduser’s part. If I am not mistaken the  
installation routine actually pulled in its own Borland C Compiler  
directory tree to do the build. Since BCC was packaged within the  
installation routine all of the compiler/linker environmental  
conditions were inherently set. Not that I particularly found Eiffel to  
be an enjoyable language, but at least the installation/build on  
Windows was a no-brainer.

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 9:52pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/9 "2006-03-15T21:52:22Z")

</div>

I know you were kidding, but I felt like sending an e-mail, so…  
A more fair comparison would be a set of Ruby build instructions for a  
Linux distro that didn’t ship with a package manager or a copy of GCC.  
Highly nontrivial.

That being said, Windows is a crazy pain in the rear. If someone with  
more build experience (like Austin) can shave some steps out of my  
writeup, I’d be happy to learn something new. It would be nice if the  
platform SDK license didn’t prevent redistribution. Then someone  
could make a self-contained build process for Ruby on win32.  
Luckily, the mswin32 distribution of Ruby is kept up to date, and most  
people never have a real need to build their own.

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 10:28pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/10 "2006-03-15T22:28:54Z")

</div>

Yes I should point out that no offence was meant to you with my previous  
email. :o)

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 10:35pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/11 "2006-03-15T22:35:07Z")

</div>

Yeah, I knew that… Didn’t mean for my response to come out sounding  
defensive.  
Windows is a discipline, like hair shirts or nettle brushes for monks.  
It focuses the mind.

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 10:59pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/12 "2006-03-15T22:59:35Z")

</div>

Just checking… do you know about this page?  
[http://www.garbagecollect.jp/ruby/mswin32/](http://www.garbagecollect.jp/ruby/mswin32/)  
They release new stable versions of Ruby there, very quickly after an  
official release comes out. They are built with Visual Studio, and  
come packaged in a zip file.  
I agree that it could use some extra documentation and publicity,  
though. Curt’s installer is nice, but contains more software than  
many people need.

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 11:24pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/13 "2006-03-15T23:24:14Z")

</div>

Yep. Personally I just need Ruby and Rubygems. Once I’ve got those  
anything else I can get myself.  
I think I vaguely remember seeing that site but haven’t tried it. Maybe  
I’ll give it a go (site appears down at the moment).  
First test (for me) will be: does RUDL work with it?

On 15/03/06, Wilson B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 3/15/06, Glenn S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > short PDF or HTML file in the root with a “getting started”. It might  
> > the  
> > install and build on it with ruby gems and so on to create their
> > 
> > > Windows is a discipline, like hair shirts or nettle brushes for monks.
> > > 
> > > > >
> > 
> > Aylesbury, UK

–

All the best  
Glenn  
Aylesbury, UK

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 15, 2006, 10:50pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/14 "2006-03-15T22:50:20Z")

</div>

I think what would be nice to achieve from all this is that when Matz  
and  
his gang release a new version of Ruby, somebody could either take this  
code  
and compile it using a HOW-TO, or for people who don’t want to have the  
hassle, quickly download a pre-compiled version. This doesn’t have to  
be  
anything fancy, such as Curt’s installer, just a zip-file which you  
extract  
and there you are - a basic c:\ruby structure (or wherever). Perhaps a  
short PDF or HTML file in the root with a “getting started”. It might  
be  
sensible to try to get rubygems integrated into this somehow but maybe  
not  
immediately.

I think there is genuine benefit in making this available to the wider  
world  
so that more people will at the very least get to have a look at Ruby  
who  
may not have bothered when all they see is a tar.gz without too much in  
the  
way of Windows help. Like it or not, plenty of Windows users out  
there…!  
It seems a small but important step forward. I’m certainly not trying  
to  
take away Curt’s job (unless he wants me to!) - there is definitely in  
my  
view a place for the one-click installer with all of it’s goodies, but  
for  
many a basic ruby install would suffice and for others they could take  
this  
install and build on it with ruby gems and so on to create their  
preferred  
environment.

I’m not sure _how_ I can help at this point, but if I can then I will,  
now  
and in the future. I would like to find a way to help the community in  
some way, just not sure where my niche is at the moment.

On 15/03/06, Wilson B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > Highly nontrivial.

–

All the best  
Glenn  
Aylesbury, UK

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 16, 2006, 9:59am UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/15 "2006-03-16T09:59:19Z")

</div>

Wilson B. schrieb:

> So simple, even a child could operate it!

_g_ Thanks for that, I’ll give it a try.

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 16, 2006, 6:18pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/16 "2006-03-16T18:18:50Z")

</div>

Just tried the version at [Index of /ruby/mswin32](http://www.garbagecollect.jp/ruby/mswin32/)

When I run IRB I get “readline.dll not found”.

Basically if Curt goes under a bus, we’re all doomed ('specially Curt!)  
:o)

On 15/03/06, Wilson B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 3/15/06, Glenn S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > short PDF or HTML file in the root with a “getting started”. It might  
> > the  
> > install and build on it with ruby gems and so on to create their
> > 
> > > Windows is a discipline, like hair shirts or nettle brushes for monks.
> > > 
> > > > >
> > 
> > Aylesbury, UK

–

All the best  
Glenn  
Aylesbury, UK

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 16, 2006, 6:52pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/17 "2006-03-16T18:52:38Z")

</div>

You can get readline (and various other things) from this page:  
[http://www.garbagecollect.jp/ruby/mswin32/en/documents/install.html](http://www.garbagecollect.jp/ruby/mswin32/en/documents/install.html)

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 16, 2006, 3:45am UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/18 "2006-03-16T03:45:26Z")

</div>

On 3/15/06, Glenn S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I think what would be nice to achieve from all this is that when Matz and  
> his gang release a new version of Ruby, somebody could either take this code  
> and compile it using a HOW-TO, or for people who don’t want to have the  
> hassle, quickly download a pre-compiled version. This doesn’t have to be  
> anything fancy, such as Curt’s installer, just a zip-file which you extract  
> and there you are - a basic c:\ruby structure (or wherever). Perhaps a  
> short PDF or HTML file in the root with a “getting started”. It might be  
> sensible to try to get rubygems integrated into this somehow but maybe not  
> immediately.

Ok here’s my contribution - I hope it is helpful:

I don’t know what to do except follow Wilson’s instructions if you  
don’t already have a working compiler. But if you already have a  
commercial VisualStudio .NET, there should already be a vsvars32.bat  
under …\Common7\Tools. There will probably also be a shortcut to it  
called “Visual Studio Command Prompt” in the program menu under  
VisualStudio .Net Tools. So to compile ruby for yourself:

1. Download and unzip the ruby source
2. run vsvars.bat
3. then in that command prompt run the attached batch file

> buildruby.bat SOURCE\_DIR [INSTALL\_DIR [ BUILD\_DIR] ]

where SOURCE\_DIR is the path to the source  
(\<unzip\_location\>\Ruby-1.8.4 if you got the latest stable version) and  
INSTALL\_DIR is the location you want ruby to go. They must be  
different directories. The intermediate files go into BUILD\_DIR,  
which defaults to INSTALL\_DIR/Build if you don’t specify it. All  
these paths can be absolute or relative. SOURCE\_DIR must exist and  
contain ruby source, but the other two will be created if they don’t  
exist.

1. change to INSTALL\_DIR and type ruby -v.

Tada!

This is tested with Visual Studio .NET and Visual Studio .NET 2003, on  
Windows XP and  
Windows 2000. Please let me know if you find any issues with it. I’d  
especially like to know if it works after following Wilson’s  
instructions to the point of creating vsvars.bat.

-Adam

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 18, 2006, 9:33pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/19 "2006-03-18T21:33:18Z")

</div>

Which trunk is the latest, Curt - installer-win2  
?[http://rubyforge.org/plugins/scmsvn/viewcvs.php/trunk/installer-win2/?root=rubyinstaller](http://rubyforge.org/plugins/scmsvn/viewcvs.php/trunk/installer-win2/?root=rubyinstaller)

On 16/03/06, Curt H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> the instructions and build scripts are checked in to subversion on  
> RubyForge:
> 
> [http://rubyforge.org/scm/?group\_id=167](http://rubyforge.org/scm/?group_id=167)
> 
> Besides, there are other people on the OCI team, and I could always  
> use more help if anyone wants to volunteer!
> 
> Curt

–

All the best  
Glenn  
Aylesbury, UK

---

<div class="post-metadata">

**Author:** ![AlphaBeta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@AlphaBeta](https://www.ruby-forum.com/u/AlphaBeta)\
**Post date:** [March 18, 2006, 10:00pm UTC](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959/20 "2006-03-18T22:00:44Z")

</div>

Has anyone tried using Code::Blocks[1] and gcc? I don’t use Windows,  
but I work on a project that just moved from vc6 to Code::Blocks and  
gcc for Windows builds.

[1] [http://www.codeblocks.org/](http://www.codeblocks.org/)

– Daniel

[Next page](https://www.ruby-forum.com/t/how-to-compile-ruby-on-windows/54959.md?page=2)
