Installing Ruby
Installing Ruby is like getting the player before you can play a video. Your computer needs Ruby installed so it can understand and run Ruby programs.
In this page:
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
# 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 in your own terminal or Node.js environment.
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the
view already swaps in the hi_ translation fields (or blanks these
out if untranslated), so this renders correctly for both languages
without a lang_code check here. #}
Common Mistakes
- Using the system Ruby on macOS for projects, which is old and needs permissions; a version manager such as
rbenvor Homebrew Ruby is safer. - Installing a gem with
sudo gem install, which can cause permission problems later. - Skipping
ruby -vafter installing, so a wrong or missing PATH is only found when a script fails.
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: