Install Ruby on Windows 11
| RubyInstaller option | |
| Run the installer with MSYS2 toolchain | |
| ruby -v | |
| gem update --system |
RubyInstaller option
Windows 11 does not include Ruby by default, so you add it with a standalone installer. For beginners the common choice is RubyInstaller, mentioned here as plain text so you can search for it by name.
Pick the 64 bit build for a modern laptop and stay with the defaults unless you have a clear reason to change them. The defaults place Ruby where the installer expects it and register it for the current user.
Run the installer with MSYS2 toolchain
Run the installer and move through the pages with Next. Keep the install location and file association options selected so scripts open with Ruby.
Near the end you will see an option to install the MSYS2 toolchain. Leave it selected and let the extra terminal window finish. That toolchain provides build tools that some gems need later.
ruby -v
Open a fresh terminal after the install finishes, then check what was installed with one short command:
Show the installed Ruby version
ruby -v
ruby 3.3.0 (2023-12-25 revision 7b0c32346b) [x64-mingw-ucrt]
You will see the word ruby followed by the version number and build details. If the terminal answers that the command was not found, close the terminal and open it again so the new settings take effect.
gem update --system
Ruby ships with a package tool called gem. The gem update --system command refreshes that tool itself, so many guides suggest running it once after a fresh install.
On Windows run the terminal as administrator if the update asks for extra rights. If everything already works, you can also leave the update for later and continue with the course.
Next: Install Ruby on Ubuntu
Article author: Arthur Isaev