# RubyInstaller2 puts an MSYS2 toolchain inside your Windows Ruby

> RubyInstaller2 is the Windows distribution of Ruby that ships a MSYS2 based build environment, so gems with C extensions compile without a separate DevKit download. The `ridk` command is the handle you use to add MSYS2 components, libraries and environment variables.

**oneclick/rubyinstaller2** — MSYS2 based RubyInstaller for Windows

- Repository: https://github.com/oneclick/rubyinstaller2
- Website: https://rubyinstaller.org
- Stars: 725 · Forks: 281
- Language: Ruby
- License: BSD-3-Clause
- Published: 2026-10-21 · Updated: 2026-10-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/oneclick-rubyinstaller2

## The problem with native gems on Windows

Ruby on Windows has a long-standing divide between the interpreter and the compiler toolchain. The original RubyInstaller shipped its own DevKit as a separate download, and the current project describes itself as providing an installer for Ruby 2.4 and newer on Windows based on the MSYS2 toolchain. The motivation for the rewrite is stated plainly in the README: in contrast to the old RubyInstaller, it does not provide its own DevKit, but makes use of the set of MINGW libraries from the MSYS2 project. The practical effect is that a gem with a C extension, which on Linux is a matter of installing a compiler, on Windows needs a whole parallel Unix-like environment. RubyInstaller2 folds that environment into the Ruby directory so the two travel together.

## The ridk command is the handle on that environment

The Devkit installer version installs a MSYS2/MINGW build environment into the ruby directory, shipping common build tools and libraries. You drive that environment through `ridk`, which the README describes as a cmd/powershell script used to install MSYS2 components, to issue MSYS commands such as `pacman`, or to set environment variables for using MSYS2 development tools from the running shell. The help output enumerates what it can do, and it is short enough to read in full.

```bash
  Usage:
      C:/Ruby24-x64/bin/ridk.cmd [option]

  Option:
      install                   Install MSYS2 and MINGW dev tools
      exec <command>            Execute a command within MSYS2 context
      enable                    Set environment variables for MSYS2
      disable                   Unset environment variables for MSYS2
      version                   Print RubyInstaller and MSYS2 versions
      use                       Switch to a different ruby version
      help | --help | -? | /?   Display this help and exit
```

The `enable` subcommand is the one that changes your current console, making `sh`, `pacman` and `make` available on the command line, and `disable` undoes it. The `use` subcommand switches between Ruby versions installed on the same machine, which is convenient when a project pins an older interpreter.

## Missing libraries come from pacman, not from a gem

The base MSYS2 setup includes compilers and other build tools, but it does not include libraries or DLLs that some gems require as dependencies. The README's point is that many of those libraries are available through the MSYS2 repositories, installed the way apt-get works on Linux, by running pacman through ridk exec. Two worked examples are given for popular gems.

```bash
ridk exec pacman -S mingw-w64-x86_64-sqlite3
gem install sqlite3 --platform ruby
```

```bash
ridk exec pacman -S mingw-w64-x86_64-libxslt
gem install nokogiri --platform ruby -- --use-system-libraries
```

The prefix matters for 32-bit installs, where the README says to exchange mingw-w64-x86_64 for mingw-w64-i686. The nokogiri example also shows the second half of the pattern: the library is installed through pacman and the gem is told to use the system libraries rather than bundling its own. For gem authors, the wiki describes how a gem can carry a label that lets pacman install the dependent libraries automatically.

## Which installer to download, and the ucrt runtime

The README says to download and install the latest RubyInstaller2 from the GitHub releases page, and it separates the choices clearly. The non-Devkit installer file is enough to use pure Ruby gems or fat binary gems for x64-mingw-ucrt or aarch64-mingw-ucrt, so the smaller package is a deliberate choice rather than a stripped one. For C based source gems, the Devkit installer version is recommended. There is also a path for people who already run MSYS2: install MSYS2 manually from msys2.org and run `ridk install` afterwards to add the non default but required development tools. Unattended installation is documented separately under a chocolatey FAQ entry, which is the route to take on a build machine that should not be clicked through by hand.

## Building the installers yourself with rake targets

This repository does not compile Ruby. The README is explicit that it provides the packaging tasks to build RubyInstaller setup executables and 7zip files, and that it makes use of the MSYS2-MINGW repository and the RubyInstaller2 pacman repository to download binaries and dependent libraries. Building on your own machine needs a working RubyInstaller 2.4+ with Git, MSYS2 installed either from a Devkit version or through `ridk install`, and the latest Inno Setup in unicode flavour on the PATH.

```bash
set PATH=%PATH%;"c:\Program Files (x86)\Inno Setup 6"
```

After that you clone, install the dependencies and ask rake to list the available targets.

```bash
git clone https://github.com/oneclick/rubyinstaller2
cd rubyinstaller2
bundle install
rake -T
```

The target names encode the variants. The README breaks the naming apart, and the pieces are the C standard library (msvcrt for the older type, ucrt for the newer one), the bitness (x86, x64, arm), the Ruby version including head for the latest development snapshot, and the flavour, where ri means RubyInstaller without Devkit and ri-msys means RubyInstaller with the MSYS2 based Devkit. A concrete target looks like this.

```bash
rake ri:ruby-3.4.1-x86-msvcrt:archive-7z
```

The repository root matches that story, with a Rakefile, a Gemfile, recipes/, packages/, resources/, gems/, lib/, bin/, docker/ and a test/ directory, plus per-series changelogs from CHANGELOG-2.4.md up to CHANGELOG-4.0.md.

## Continuous builds and the ruby-head channel

The README says the installer is regularly built on GitHub Actions for each push to the repository, and that the runner also executes the installer and runs all RubyInstaller tests and the ruby-spec suite on it, so breaking changes are surfaced by the build rather than by users. On top of that, a daily build of the latest Ruby development snapshot is compiled and packaged as RubyInstaller files and published under the rubyinstaller-head tag, with a wiki page on using those versions for CI builds. That is the answer for teams who want to track the newest interpreter without waiting for a tagged installer.

## BSD-3-Clause, release history and the maintenance signal

The project is licensed under the 3-clause Modified BSD License, and the repository carries LICENSE.txt alongside the per-series changelogs, so the terms are readable next to the version history. Recent tags give a clear picture of the release rhythm: RubyInstaller-3.4.11-1 from 2026-09-25, RubyInstaller-4.0.7-1 from 2026-09-15 and RubyInstaller-3.3.12-1 from 2026-07-21, which means the 3.x line is still being patched alongside the newer 4.0 series rather than abandoned. The repository is not archived, and the last push was on 2026-10-15, so both the code and the CI pipeline behind the installers are still moving.

## Conclusion

Adopt RubyInstaller2 when you develop Ruby on Windows and any dependency has a C extension, because the DevKit variant removes the separate compiler setup step and lets pacman supply missing libraries. Do not adopt it for a machine that only needs pure Ruby gems, where the non-Devkit installer is already enough, and do not expect the build recipes to compile Ruby itself, since the repository downloads binaries from the MSYS2-MINGW and RubyInstaller2 pacman repositories. Before switching, check that your project needs the ucrt runtime, run ridk version to see the MSYS2 state, and confirm that the gem installs still need the documented pacman packages for their dependencies.

## FAQ

### What is RubyInstaller2 and what does the Devkit variant add?

RubyInstaller2 provides an installer for Ruby 2.4 and newer on Windows based on the MSYS2 toolchain. The Devkit installer version installs a MSYS2/MINGW build environment into the ruby directory that ships common build tools and libraries, which is what C based source gems need.

### How do I install a gem that needs a C extension on Windows with RubyInstaller2?

The README shows installing the missing library through pacman and then the gem itself, for example ridk exec pacman -S mingw-w64-x86_64-sqlite3 followed by gem install sqlite3 --platform ruby. For a 32-bit RubyInstaller, exchange the mingw-w64-x86_64 prefix for mingw-w64-i686.

### What does the ridk command do in RubyInstaller2?

ridk is a cmd/powershell script that installs MSYS2 components, issues MSYS commands such as pacman, and sets environment variables for using MSYS2 development tools from the running shell. Its subcommands include install, exec, enable, disable, version, use and help.

### Do I need the Devkit installer if I only use pure Ruby gems?

No. The README states that the non-Devkit installer file is enough for pure Ruby gems or fat binary gems for x64-mingw-ucrt or aarch64-mingw-ucrt. The Devkit version is recommended for installing C based source gems.

### How do I build the RubyInstaller2 installers on my own machine?

You need RubyInstaller 2.4+ with Git, MSYS2 from a Devkit version or ridk install, and Inno Setup in unicode on the PATH. The README then shows cloning the repository, running bundle install and listing the build targets with rake -T.

## Sources

- [License: BSD-3-Clause](https://github.com/oneclick/rubyinstaller2/blob/master/LICENSE)
- [oneclick/rubyinstaller2 on GitHub](https://github.com/oneclick/rubyinstaller2)
- [Project website](https://rubyinstaller.org)
- [README](https://github.com/oneclick/rubyinstaller2/blob/master/README.md)
- [Releases](https://github.com/oneclick/rubyinstaller2/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/oneclick-rubyinstaller2
