Windows

How to Install Ruby on Windows 11: 3 Main Methods

In this tutorial, we will learn how to set up the latest version of Ruby interpreter on Windows 11 using various methods.
Captain Salem 5 min read
How to Install Ruby on Windows 11: 3 Main Methods

Windows

Ruby is a dynamic, object-oriented, general-purpose programming language that features automatic memory management and supports multiple programming paradigms, including functional, procedural, and object-oriented programming. It has a simple and expressive syntax allows developers to write code quickly and efficiently.

Let us dive in.

Requirements

  1. Windows 10 and above
  2. Administrative permissions
  3. Access to Command Prompt or PowerShell
  4. A working Network Connection.

Method 1 - Install Ruby Using RubyInstaller

RubyInstaller is a software package for Microsoft Windows that provides a self-contained installation of the Ruby programming language, including the Ruby language interpreter, development tools, and libraries. It is designed to make it easy for developers to install Ruby on their Windows machines and develop Ruby applications quickly.

The RubyInstaller includes a precompiled version of the Ruby interpreter and many libraries and tools commonly used in Ruby development, such as the RubyGems package manager and the Bundler dependency management tool. The installer also includes many development tools, such as the Ruby Development Kit (DevKit), which provides development tools and libraries that allow developers to build native C/C++ extensions for Ruby.

Step 1 - Download the RubyInstaller

Open your browser and head over to the RubyInstaller downloads page provided in the link below:

Downloads
The easy way to install Ruby on Windows This is a self-contained Windows-based installer that includes the Ruby language, an execution environment, important…

You will find two options on the downloads page: one with DevKit and the other without a DevKit.

If you want to use the system for developing software, ensure to include the Ruby version with a DevKit; otherwise, if you are only interested in the Ruby interpreter, select the one without.

Step 2 - Launch the Installer

Once the download is complete, double-click to open the installer program. This may prompt you whether you wish to install Ruby for you or all accounts in the system.

In the next step, accept the License and click Next to proceed.

Next, configure the destination directory. Once satisfied with the configuration options, click Install to setup Ruby on your machine.

In the Components page, choose the target components you wish to install or skip.

Once the installation is complete, the installer may require you to install the MSYS2 Package.

Select the option and click Finish.

In the Prompt window, choose the MSYS2 Base Installation to configure and set up MSYS2 on your system.

What is MSYS2?

MSYS2 is a collection of software packages for Microsoft Windows that provides a Unix-like environment for the development and execution of command-line applications and scripts. It is designed to provide a full-featured POSIX environment on Windows, including a bash shell, GNU utilities, and other development tools commonly found on Unix-like operating systems.

Wait for the process to complete, and you should set up the Ruby interpreter on your system.

Method 2 - Install Ruby Using WinGet.

The second method we can use to install Ruby on Windows is using the Windows Package Manager, also known as WinGet.

If you do not have WinGet installed on your machine, you can check the resource below:

How to install Windows Package Manager
Discover how you can setup and use the winget package manager on your Windows system.

However, if you have WinGet setup on your machine, open the command prompt as administrator and run the command:

winget install -e --id RubyInstallerTeam.Ruby.2.7

And boom, the command above should download and install the Ruby interpreter on your Windows machine.

Method 3 - Install Ruby Using Scoop

Scoop is the third method we can use to install Ruby on a Windows machine. Scoop is a feature-rich package manager for Windows.

You can learn how to install Scoop on your Windows system in the article below:

How to Install Scoop on Windows
In this post, we will quickly go over how you can quickly install and configure Scoop package manager on Windows in easy steps.

Once Scoop is installed, open the command prompt as administrator and update Scoop as:

scoop update

Next, add the main bucket with the command:

scoop bucket add main

Finally, install Ruby with the command:

scoop install ruby

Verify Ruby is Installed

Once you have installed Ruby using either of the abovementioned methods, it is time to verify that Ruby is working.

Open the command prompt and run the command:

irb --version

The command above should return the installed version of the Ruby interpreter as shown in the sample output above.

irb 1.6.2 (2022-12-13)

And there you have it, you have successfully installed Ruby on a Windows system.

Conclusion

In conclusion, installing Ruby on your Windows computer is a straightforward process that can be done using various tools such as RubyInstaller, WinGet, and Scoop.

RubyInstaller is the most popular and easiest way to install Ruby on Windows. However, WinGet and Scoop offer more advanced features like package management and easy updates. Regardless of your chosen method, once installed, Ruby provides a powerful and versatile programming language that can be used for web development, scripting, and many other applications. Happy coding!

We hope you enjoyed this tutorial. Leave us a comment below and show your love.

If you enjoy our content, please consider buying us a coffee to support our work:

Share
Comments
More from GeekBits

Join us at GeekBits

Join our members and get a currated list of awesome articles each month.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to GeekBits.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.