There are basically 2 ways to install and run Ruby on Windows. The simple and straightforward method is to use the Ruby installer. The more robust method is to install the Linux subsystem on Windows 10, then use Linux commands to install Ruby.
Step 1: Click on this link
Step 2: Select the latest stable x64 or x86 version depending upon your system compatibility. If the system is used for developing software use a version With Devkit (Developer’s Kit). The Devkit versions install the MSYS2 system, which will be required if you need to install RubyGems that require compilation. If you want to work on a Ruby on Rails app, you’ll definitely need to compile gems, so you need the Devkit. If you only need to run Ruby applications, use the version Without Devkit.
Step 3: Accept the licence agreement after opening the installer file
Step 4: Select both checkboxes and click on install
Step 5: Make sure MSYS2 is selected and click Next
Step 6: Make sure you have selected run ridk install and click next
Step 7: Press Enter Here
Step 8: Press Enter Again
Step 9: Open command prompt and test using following commands
$ ruby -v
$ gem list
$ irb