_If you wish to report errors or suggest improvements for this FAQ,
please go to our
[GitHub repository](https://github.com/ruby/www.ruby-lang.org/)
and open an issue or pull request._


## Installing Ruby

For current information on downloading and installing Ruby
see the [Installation](/en/documentation/installation/)
or [Downloads](/en/downloads/) page.

### What operating systems support Ruby?

<div class="not-prose bg-ruby-100 dark:bg-ruby-800 rounded-lg p-8 my-6">
  <div class="flex items-start gap-3">
    <svg class="w-6 h-6 text-ruby-700 dark:text-ruby-200 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
      <path fill-rule="evenodd" d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"/>
    </svg>
    <p class="text-sm text-ruby-700 dark:text-ruby-200 italic">
      This section or parts of it might be out-dated or in need of confirmation.
    </p>
  </div>
</div>


Ruby is developed under Linux, and is written in fairly straightforward C.
It runs under Linux and other UNIX-like operating systems, macOS,
Windows, DOS, BeOS, Amiga, Acorn Risc OS, and OS/2.

### Where can I get Ruby sources?

The latest version of Ruby can be downloaded from:
[www.ruby-lang.org/en/downloads/](/en/downloads/).
Mirror sites are also listed on this page.

Also on this page is a link to a nightly snapshot of the development tree.

### Can I get to the development source tree?

<div class="not-prose bg-ruby-100 dark:bg-ruby-800 rounded-lg p-8 my-6">
  <div class="flex items-start gap-3">
    <svg class="w-6 h-6 text-ruby-700 dark:text-ruby-200 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
      <path fill-rule="evenodd" d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"/>
    </svg>
    <p class="text-sm text-ruby-700 dark:text-ruby-200 italic">
      This section or parts of it might be out-dated or in need of confirmation.
    </p>
  </div>
</div>


If you have a CVS client, you can check out the current source tree using:

~~~
$ cvs -d :pserver:anonymous@cvs.netlab.co.jp:/home/cvs login
(Logging in to anonymous@cvs.netlab.co.jp)
CVS password: guest
$ cvs -d :pserver:anonymous@cvs.netlab.co.jp:/home/cvs co ruby
~~~

If you do not have CVS you can get a nightly snapshot of the development
source from
[https://cache.ruby-lang.org/pub/ruby/snapshot.tar.gz](https://cache.ruby-lang.org/pub/ruby/snapshot.tar.gz).

### How do I compile Ruby?

Under Unix, Ruby uses the `autoconf` system to configure the build
environment. You don't need the `autoconf` command on your box to build Ruby
from a distribution; just use the commands:

~~~
$ ./configure [configure options]
$ make
$ make test
$ make install
~~~

You may need superuser privileges to install Ruby if you don't override the
default installation location (`/usr/local`). You can get a full list of
`configure` options using:

~~~
$ ./configure --help
~~~

If you are working from the source repository, you may need to run
`autoconf` before running `configure`.

### How do I tell Ruby where my libraries are?

<div class="not-prose bg-ruby-100 dark:bg-ruby-800 rounded-lg p-8 my-6">
  <div class="flex items-start gap-3">
    <svg class="w-6 h-6 text-ruby-700 dark:text-ruby-200 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
      <path fill-rule="evenodd" d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"/>
    </svg>
    <p class="text-sm text-ruby-700 dark:text-ruby-200 italic">
      This section or parts of it might be out-dated or in need of confirmation.
    </p>
  </div>
</div>


On some systems, the build process may fail to find libraries used by
extension modules (for example the `dbm` libraries).

You can tell Ruby where to find libraries using options to `configure`.
From [\[ruby-talk:5041\]][ruby-talk:5041]:

~~~
$ ./configure --with-xxx-yyy=DIR
~~~

where xxx is either

~~~
opt           extra software path in general
dbm           path for dbm library
gdbm          path for gdbm library
x11           ...for X11..
tk            ...for Tk...
tcl           ...for Tcl...
~~~

and yyy is either

~~~
dir           specifies -I DIR/include -L DIR/lib
include       specifies -I DIR
lib           specifies -L DIR
~~~

On HP-UX, there may be problems building with `gcc`. Try using the native
compiler instead. WATANABE Tetsuya recommends:

~~~
$ CC="cc -Ae" CFLAGS=-O ./configure --prefix=/opt/gnu
~~~

There may also be problems with HP's native `sed`.
He recommends installing the GNU equivalent.

[ruby-talk:5041]: https://blade.ruby-lang.org/ruby-talk/5041

### Are precompiled binaries available?

A single download that contains everything you need to run Ruby under various
Windows operating systems is available from [RubyInstaller](https://rubyinstaller.org/).

[Reuben Thomas](mailto:Reuben.Thomas@cl.cam.ac.uk) writes:

> You could mention that there's a port to Acorn RISC OS, currently of v1.4.3.
> I made the port, and have no plans to maintain it, but I did send the
> patches to matz, so newer versions may well compile too.

### What's all this “cygwin”, “mingw”, and “djgpp” stuff?

<div class="not-prose bg-ruby-100 dark:bg-ruby-800 rounded-lg p-8 my-6">
  <div class="flex items-start gap-3">
    <svg class="w-6 h-6 text-ruby-700 dark:text-ruby-200 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
      <path fill-rule="evenodd" d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"/>
    </svg>
    <p class="text-sm text-ruby-700 dark:text-ruby-200 italic">
      This section or parts of it might be out-dated or in need of confirmation.
    </p>
  </div>
</div>


Ruby is written to take advantage of the rich feature set of a Unix
environment. Unfortunately, Windows is missing some of the functions, and
implements others differently. As a result, some kind of mapping layer is
needed to run Ruby (and other Unix-based programs) under Windows.

You may come across different versions of the Ruby executable that use
different wrapper mapping layers.

The rbdj version is a stand-alone version of the Windows binary of Ruby.
It uses the DJ Delorie tools
([http://www.delorie.com](http://www.delorie.com)).

The rbcw version is a Windows binary of Ruby that requires the cygwin library,
available at [http://www.cygwin.com](http://www.cygwin.com) or from the
Ruby download pages. Cygwin is both an emulation layer and a set of
utilities initially produced by Cygnus Solutions (now part of Redhat).
The cygwin version of Ruby probably has the fullest set of features under
Windows, so most programmers will want to use it.

To use the rbcw version, you will need to install the cygwin .dll separately.
Once you have installed cygwin on your computer, copy `cygwin1.dll` (which
is found in the `bin` subdirectory of the cygwin distribution) to your
`Windows\System32` folder (or somewhere else on your path).

Thanks to Anders Schneiderman for the basis of this description.

### Why doesn't Tk graphics work under Windows?

<div class="not-prose bg-ruby-100 dark:bg-ruby-800 rounded-lg p-8 my-6">
  <div class="flex items-start gap-3">
    <svg class="w-6 h-6 text-ruby-700 dark:text-ruby-200 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
      <path fill-rule="evenodd" d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"/>
    </svg>
    <p class="text-sm text-ruby-700 dark:text-ruby-200 italic">
      This section or parts of it might be out-dated or in need of confirmation.
    </p>
  </div>
</div>


Is Tk installed correctly on your Windows box? Go to
[https://wiki.tcl-lang.org/page/Binary+Distributions](https://wiki.tcl-lang.org/page/Binary+Distributions#85b8647b1ec80c2fa1698c3c7e76204a944a95db2487347c51773f26b9dad6ae)
to find a precompiled binary Tcl/Tk distribution for your box.

Are the environment variables `TCL_LIBRARY` and `TK_LIBRARY` pointing to the
directories containing tcl and tk?

Is the tk library in your path?
