Install Ruby and verify both the interpreter and RubyGems before starting a project. Keep each project in its own folder.
What you need
- Ruby from an installation method linked by ruby-lang.org
- A code editor and terminal
- On Windows, RubyInstaller with Devkit is a common choice
Set up your environment
- Use the Ruby installation page to choose an installer or version manager for your operating system.
- On Windows, follow RubyInstaller instructions; complete any Devkit steps required for native gems. Reopen the terminal.
- Check
ruby --versionandgem --version. Create a practice folder and save hello.rb. - Run the program. Later projects can use Bundler and a Gemfile to record their own dependencies.
Your first check
Save as hello.rb
name = 'Teacher'
puts "Hello, #{name}!"Run or verify
ruby hello.rbExpected result: Hello, Teacher! is printed.
Common setup problems
- If ruby is missing, check the installer instructions and reopen the terminal.
- A gem build error may require the platform development tools; on Windows check the Devkit installation rather than using an unrelated executable.
Official documentation
Guide reviewed 17 November 2026. Check the linked vendor documentation for current supported versions and operating systems.