Contents

Ruby 2D on Windows

Learn how to set up your Ruby environment on Windows

✏️ Suggest an edit to this page »

Ruby 2D works with 64-bit Windows and is tested on the latest releases of Windows 10 (but will probably work with previous versions as well). While there are several ways to get Ruby on Windows, Ruby 2D requires a MinGW environment. We recommend using the latest RubyInstaller for Windows, which is based on MSYS2 (the Ruby 2.3 and older installers are no longer supported). You can download and run the installer, or use Chocolatey to get Ruby and MSYS2 — instructions for both are below.

Show instructions for: RubyInstaller (recommended) or Chocolatey

Install Ruby

  1. Go to RubyInstaller download page and download the latest Ruby+Devkit 64-bit release (the one with x64 in the name).

  2. Run the installer (leaving the default options is fine). When finished installing, keep the “Run ‘ridk install’” option selected to install MSYS2 and the development toolchain.

  3. When prompted for “Which components shall be installed”, just press “enter” to install all of them. When finished installing, press “enter” again to quit.

  1. Install Chocolatey.

  2. Install the Ruby and MSYS2 packages with choco install ruby msys2

  3. To be able to build native gem extensions, install the MinGW compiler toolchain by opening a MinGW 64-bit command prompt (located at C:\tools\msys64\mingw64.exe) and running:

    pacman -S make mingw-w64-x86_64-gcc
    

Launching Ruby

There are a couple ways to launch a Ruby environment:

  • For a Bash-like experience, use a MinGW 64-bit command prompt from C:\Ruby26-x64\msys64\mingw64.exe (your Ruby directory might differ based on the version you installed). Make sure to add ruby to your $PATH variable, for example by running the following (again, your Ruby directory might be different):
    echo 'export PATH=$PATH:/c/Ruby26-x64/bin' >> ~/.bash_profile
    

    To get access to Ruby in the current shell, run source ~/.bash_profile. Ruby should now be available for this and all new shells. Try running ruby --version to check. At this time, you might also want to create a convenient shortcut to the mingw64.exe shell.

  • For a Bash-like experience, use a MinGW 64-bit command prompt from C:\tools\msys64\mingw64.exe. Make sure to add ruby to your $PATH variable, for example by running the following (your Ruby directory might be different):
    echo 'export PATH=$PATH:/c/tools/ruby26/bin' >> ~/.bash_profile
    

    To get access to Ruby in the current shell, run source ~/.bash_profile. Ruby should now be available for this and all new shells. Try running ruby --version to check. At this time, you might also want to create a convenient shortcut to the mingw64.exe shell.

That’s it! Head back to the “get started” guide and write your first 2D app »