Install Ruby on Rails
on macOS & Windows.
The fastest working setup for Rails 8 — copy-paste commands, curated install videos, and pointers to the official guides. Beginner-friendly, no hand-waving.
Install Ruby & Rails on macOS
Homebrew installs the C toolchain, rbenv manages Ruby versions, and gem install rails finishes the job. Works on Apple Silicon and Intel Macs.
- 1. Install Homebrew.
- 2. Install rbenv + ruby-build.
- 3.
rbenv installthe latest Ruby 3.x. - 4.
gem install rails. - 5.
rails new blogand start the server.
# 1. Install Homebrew (skip if you already have it)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 2. Install rbenv + ruby-build
brew install rbenv ruby-build
echo 'eval "$(rbenv init - zsh)"' >> ~/.zshrc
exec zsh
# 3. Install and activate the latest Ruby
rbenv install 3.3.5
rbenv global 3.3.5
ruby -v # => ruby 3.3.5
# 4. Install Rails
gem install rails
rails --version # => Rails 8.x
# 5. Create your first app
rails new blog
cd blog
bin/rails server
# → open http://localhost:3000Install Ruby & Rails on Windows
Two supported paths: RubyInstaller for the quickest start, and WSL2 + Ubuntu for the smoothest long-term Rails experience.
- A1. Download Ruby+Devkit from rubyinstaller.org.
- A2. Accept the MSYS2 setup at the end of the installer.
- A3.
gem install rails. - B. Or run
wsl --install -d Ubuntuand follow the macOS steps inside Ubuntu.
# Option A — Native (fastest for learners)
# 1. Download Ruby+Devkit from https://rubyinstaller.org
# Pick the latest "WITH DEVKIT" installer (x64).
# 2. Run the installer. At the final step accept the MSYS2 setup
# and press ENTER to install the default components (1, 3).
# 3. Open a NEW "Start Command Prompt with Ruby" and run:
ruby -v
gem install rails
rails --version
rails new blog
cd blog
bin\rails server
# Option B — WSL2 + Ubuntu (recommended for real projects)
wsl --install -d Ubuntu
# Then reboot, open Ubuntu, and follow the macOS steps above.Best install videos & docs
The install guides Rails developers actually recommend — hand-picked, kept up to date by their authors.
- Install Ruby on Rails · macOS (GoRails)
Official GoRails install script — Homebrew + asdf, updated per macOS release.
- Install Ruby on Rails · Windows (GoRails)
GoRails' Windows walkthrough — RubyInstaller and WSL2 both covered.
- Getting Started with Rails (official guide)
The canonical Rails guide — installation, generators, and your first CRUD app.
- rbenv — simple Ruby version management
The Ruby version manager most Rails developers on macOS use.
- RubyInstaller for Windows
Official Windows installer, bundled with MSYS2 devkit.
Common install errors
The four errors that trip up nearly every first-time Rails installer, and how to fix them without reinstalling everything.
- "command not found: rails" after gem install
- Open a new terminal (so the PATH/shim reloads). On macOS, confirm rbenv is initialised in ~/.zshrc.
- "Could not find gem 'sqlite3'" when running rails new
- On macOS: `brew install sqlite3`. On Windows native: the RubyInstaller DevKit ships everything; make sure you accepted MSYS2 at the end.
- Node / Yarn errors on rails new
- Rails 7+ defaults to importmap, no Node needed. If you picked --javascript=esbuild or --css=tailwind, install Node LTS and Yarn first.
- Rails runs but pages 500 on first request
- Run `bin/rails db:prepare` — the sample app expects the database to exist and be migrated.