← Back to Ruby Course | Chapter 1: Setup & Basics | Lesson 2 of 7

Installing Ruby

In this page:

  1. Installing Ruby

Installing Ruby

Ruby needs to be installed before you can run any Ruby script, and it's available on Linux, macOS, and Windows through various installers. Most developers use a version manager like rbenv or rvm to switch between Ruby versions per project, rather than a single system-wide install. Package managers like apt, brew, and choco also provide direct installs.

Note: Run ruby -v after installing to confirm the interpreter is on your PATH.

Example: Installing Ruby

bash
# Linux (Ubuntu/Debian)
sudo apt-get update && sudo apt-get install -y ruby-full

# macOS (Homebrew)
brew install ruby

# Windows (Chocolatey)
choco install ruby

# Verify installation (all platforms)
ruby -v

⚠️ Run this command in your terminal.

🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.