Getting Started with Ruby & Rails on Windows

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 WSLwsl --install This will install Ubuntu by default.
  2. Update and install dependencies inside Ubuntu terminalsudo 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 Railsgem install rails
  5. Verify installationsruby -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.orgDownload 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 Versionsruby -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

ToolWindows Option
RubyRubyInstaller OR rbenv via WSL
Railsgem install rails
GitGit for Windows
Code EditorVS Code
Terminal (WSL)Ubuntu app from Microsoft Store

Summary: Which Setup is Best?

SetupProsCons
WSLMost compatible, Linux-like environmentSlightly more setup effort
RubyInstallerSimple to install, native WindowsCompatibility issues with some gems/tools

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

Leave a Comment