[Forum] How to Check My Ruby Version on Windows?

5/5 - (1 vote)

πŸ’¬ Post by NewCoder123: Hi everyone, I’ve been getting into Ruby programming and installed Ruby on my Windows machine. However, I’m not sure which version I’m currently using. Could someone help me figure out how to check my Ruby version on Windows? Thanks!

πŸ’‘ Best Answer by DevHelper99: Hello NewCoder123, Checking the version of Ruby installed on your Windows system is quite straightforward. Here’s a detailed guide to help you verify your Ruby installation:

Step 1: Open Command Prompt

To begin, you need to open your Command Prompt. Here are a couple of ways to do this:

  • You can search for “cmd” in the Start menu, and then click on “Command Prompt”.
  • Alternatively, press Win + R, type cmd, and press Enter.

Step 2: Check Ruby Version

Once you have your Command Prompt window open, type the following command and press Enter:

ruby -v

This command will display the version of Ruby that is currently installed on your machine. The output will generally look something like this:

ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x64-mingw32]

In this example, 2.7.2 is the version number, and the rest of the string provides additional build information.

Step 3: Interpreting the Results

If you see a version number, Ruby is installed and working correctly. If you get an error saying that “ruby is not recognized as an internal or external command, operable program or batch file,” it likely means that Ruby isn’t installed or hasn’t been added to your system’s PATH.

Additional Tips:

  • Installing/Updating Ruby: If you need to install Ruby or update to a newer version, I recommend using RubyInstaller for Windows. It simplifies the installation process and automatically sets up everything you need.
  • Using a Version Manager: For managing different Ruby versions, you can use tools like uru which is a lightweight, multi-platform command line tool specifically designed for Windows.

Resources for Further Learning:

Let me know if you need more help with Ruby on Windows, and happy coding!

πŸ’¬ Reply from NewCoder123: Thanks, DevHelper99! Your instructions were perfect. I found out I needed to add Ruby to my PATH. All sorted now, and I’m ready to continue learning Ruby. Appreciate the help!