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

IRB (Interactive Ruby)

In this page:

  1. IRB (Interactive Ruby)

IRB (Interactive Ruby)

IRB is Ruby's interactive console, started by typing irb in a terminal, where you can type expressions and see results immediately. It's the fastest way to experiment with small snippets of Ruby without creating a file. Every expression's result is automatically printed, similar to a calculator.

Note: Type exit or press Ctrl+D to leave an IRB session.

Example: IRB (Interactive Ruby)

markup
# Simulating what you'd see interacting with irb:
puts "2 + 2 = #{2 + 2}"
puts "In irb, typing '2 + 2' alone would print '=> 4' automatically"
🔒

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.