Yes, you can install Ruby on Windows 10 using the RubyInstaller for Windows, which bundles the language, a package manager, and a development kit in one setup. This guide walks you through the official installer method, plus alternatives like WSL and Chocolatey, so you can choose what fits your workflow.
Why Install Ruby on Windows?
Ruby is a dynamic, open-source programming language known for its readable syntax and productivity. It powers popular web frameworks like Ruby on Rails, automation tools like Chef, and countless command-line utilities. While macOS and Linux are the traditional homes for Ruby development, Windows 10 is fully capable of running Ruby for learning, scripting, and building web apps. The main challenge is that some Ruby gems (libraries) compile native C extensions, which is why the RubyInstaller includes the MSYS2 development kit to provide the necessary compilers and tools.
Prerequisites and What to Download
Before you start, ensure your Windows 10 is up to date and you have administrator rights to install software. The official download is from rubyinstaller.org, which offers two versions: the Devkit version (recommended) and the plain version. The Devkit includes MSYS2, which is required for building native extensions. Choose the latest stable 64-bit version (e.g., Ruby 3.2.x or 3.3.x) unless you have a 32-bit system, which is rare. Download the .exe file—it’s around 150–200 MB.
Step-by-Step Installation
- Run the downloaded installer (e.g.,
rubyinstaller-devkit-3.3.5-1-x64.exe). - Accept the license, choose an installation directory (default is
C:\Ruby33-x64), and ensure the options “Add Ruby executables to your PATH� and “Associate .rb and .rbw files� are checked. - Click Install and wait for the files to copy.
- When the installer finishes, it opens a command prompt asking whether to install MSYS2. Press Enter to accept.
- In the MSYS2 setup, choose option 3 (or the recommended default) to install the full toolchain. This downloads additional packages and may take several minutes.
- Once done, close the terminal and open a new Command Prompt or PowerShell window.
- Verify the installation by typing
ruby -vandgem -v. You should see version numbers likeruby 3.3.5and3.5.23.
Alternatives: WSL and Chocolatey
If you plan to develop Rails apps or use gems that rely heavily on native extensions, consider installing Ruby via the Windows Subsystem for Linux (WSL). WSL gives you a real Linux environment on Windows, so Ruby behaves exactly as it would on a Linux server. To do this, enable WSL from the Windows Features panel, install a distribution like Ubuntu from the Microsoft Store, then run sudo apt install ruby-full. This method is often smoother for Rails development.
Another option is the Chocolatey package manager. If you already use Chocolatey, run choco install ruby in an elevated prompt. This installs Ruby and adds it to PATH automatically, but you still need to run the ridk install command afterward to set up MSYS2. The RubyInstaller remains the most straightforward for most users.
Common Problems and Fixes
- “ruby is not recognized as an internal or external command� – This means the PATH is not set. Re-run the installer, ensure the PATH option is checked, or manually add
C:\Ruby33-x64\binto your system PATH via System Properties → Environment Variables. - “ERROR: While executing gem … (Gem::FilePermissionError)â€� – This happens when you try to install gems without admin rights. Use
gem install --user-installor open the terminal as Administrator. - Native gem fails to build (e.g.,
json,nokogiri) – MSYS2 might not be fully installed. Runridk installagain and select option 3 to install the complete toolchain. - Ruby is slow or hangs – Antivirus software can interfere. Add the Ruby directory to the exclusion list, or temporarily disable real-time scanning during installation.
- Encoding errors when reading files – Windows uses different default encodings. Add
# encoding: UTF-8at the top of your Ruby files or setENV['RUBYOPT']='-Eutf-8'temporarily.
What to Do After Installation
Once Ruby is running, you can test it with a simple script. Create a file named hello.rb containing puts "Hello, Windows!" and run ruby hello.rb in the terminal. You can also use the interactive Ruby shell (irb) to experiment. To install gems, use gem install , for example gem install rails to get the Rails framework. Remember that some gems require the MSYS2 toolchain, which you already installed.
For editing code, any text editor works, but Visual Studio Code with the Ruby extension provides syntax highlighting and debugging. You can also use a full IDE like RubyMine, though it’s paid.
Costs, Safety, and Maintenance
Ruby and RubyInstaller are completely free and open-source. There are no hidden costs. The installer is signed by the RubyInstaller team, so you can verify the digital signature before running it. Always download from the official site to avoid malicious copies. To keep Ruby updated, periodically check the RubyInstaller website for new releases and run the installer again, or use gem update to update installed gems. For development, it’s also wise to keep MSYS2 updated by running ridk update in the terminal.
Frequently Asked Questions
Do I need to install MSYS2 separately?
No, the RubyInstaller Devkit includes MSYS2. During installation, you’ll be prompted to install it. If you skipped that step, you can run ridk install later to set it up.
Can I use Ruby on Rails on Windows 10?
Yes, Rails works on Windows, but some gems (like sqlite3 or bootsnap) may require extra setup. Using WSL is often recommended for Rails development because it avoids most native compilation issues, but RubyInstaller with MSYS2 is sufficient for many projects.
How do I uninstall Ruby?
Use the Windows Settings → Apps → Installed apps, find Ruby, and click Uninstall. You may also want to remove the MSYS2 directory if it remains, and clean up the PATH entries.
What is the difference between Ruby 3.2 and 3.3?
Ruby 3.3 is the newer release with performance improvements, a new parser (Prism), and better memory usage. For most users, the latest stable version is recommended. Check the official release notes for details.
Why do I get a “cannot load such file — sqlite3â€� error?
This means the sqlite3 gem is not installed or failed to build. Run gem install sqlite3 and ensure MSYS2 is installed. If it still fails, try gem install sqlite3 --platform ruby or use the sqlite3-ruby gem.
Is Ruby on Windows slower than on Linux?
For CPU-bound tasks, Ruby performance is similar. File I/O and process spawning can be slower on Windows due to OS differences, but for most scripts and web apps, the difference is negligible.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Nimbus Projects Financial Metrics to Check Before Investing12.0 months
- Send Confidential Email in Gmail with Password
- Nokia X Recent Apps List: How to Create It
- How to Show Mail as Plain Text in Outlook
- Google Photos Storage Limit: How It Works
- Fix Windows 10 Desktop Unavailable Issue