Getting Started with Ruby & Rails on Windows

Leader posted 2 min read

If you're on Windows, you can still develop with Ruby and Rails . Let's walk through your options and the steps involved.

There are two main options:


️ Option A: Use WSL (Recommended)

WSL stands for Windows Subsystem for Linux — it lets you run a full Linux environment on Windows without dual-booting or using a virtual machine.

Best for: Developers who want a smooth Rails experience and compatibility with Linux tools.


Steps to Set Up Rails with WSL
  1. Install WSL

    wsl --install
    

    This will install Ubuntu by default.

  2. Update and install dependencies inside Ubuntu terminal

    sudo apt update && sudo apt upgrade
    sudo apt install curl git build-essential libssl-dev libreadline-dev zlib1g-dev
    
  3. Install Ruby (using a version manager like rbenv or rvm)

    curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-installer | bash
    echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
    echo 'eval "$(rbenv init -)"' >> ~/.bashrc
    source ~/.bashrc
    
    rbenv install 3.3.0
    rbenv global 3.3.0
    
  4. Install Rails

    gem install rails
    
  5. Verify installations

    ruby -v
    rails -v
    

️ Option B: Use RubyInstaller for Windows (Native Ruby)

If you don’t want to use WSL, you can install Ruby directly in Windows.

Steps for Native Windows Setup
  1. Download Ruby Installer
    Go to: https://rubyinstaller.org

    Download a version like Ruby+Devkit 3.3.X.

  2. Run the Installer

    • Make sure you check the box that says “Add Ruby executables to your PATH”.
    • Choose to run ridk install after installation (this installs DevKit, MSYS2).
  3. Install Rails
    Open Command Prompt or PowerShell and run:

    gem install rails
    
  4. Check Versions

    ruby -v
    rails -v
    

Note: Some gems (e.g., pg for PostgreSQL) can be tricky to install on native Windows due to compilation issues. That’s why WSL is highly recommended.


Database Setup for Windows


Common Tools

Tool Windows Option
Ruby RubyInstaller OR rbenv via WSL
Rails gem install rails
Git Git for Windows
Code Editor VS Code
Terminal (WSL) Ubuntu app from Microsoft Store

Summary: Which Setup is Best?

Setup Pros Cons
WSL Most compatible, Linux-like environment Slightly more setup effort
RubyInstaller Simple to install, native Windows Compatibility issues with some gems/tools

Recommendation: Use WSL + Ubuntu for the best Rails development experience on Windows.


If you read this far, tweet to the author to show them you care. Tweet a Thanks

More Posts

Scaling Sidekiq in Ruby on Rails: Best Practices, War Stories, and WTF Moments

Dghim Sami - Aug 24

Welcome to the Ruby & Rails Community

BrazenBraden - Oct 1

Getting Started with Backend Development: Web Servers, Node.js, and Bun Explained

Santwan pathak - Jul 20

Better Sidekiq Classes

BrazenBraden - Aug 28

JuggleBee’s Great Leap - Rebuilding a Rails 4 App in Rails 8 (Part 1)

BrazenBraden - Aug 21
chevron_left