LinuxCommandLibrary

irb

interactive Ruby shell

TLDR

Start interactive Ruby

$ irb
copy
Start without prompt
$ irb --noprompt
copy
Load file before starting
$ irb -r [library]
copy
Evaluate expression
$ irb -e "[puts 'hello']"
copy
Start with specific Ruby
$ irb --version
copy
Simple prompt
$ irb --simple-prompt
copy

SYNOPSIS

irb [options] [file]

DESCRIPTION

irb is the Interactive Ruby shell. It provides a REPL for evaluating Ruby expressions and exploring code.
The shell supports tab completion, history, and multi-line input. It's the standard tool for Ruby experimentation.

PARAMETERS

-r LIBRARY

Require library before starting.
-e EXPR
Evaluate expression.
--noprompt
Suppress prompt.
--simple-prompt
Use simple prompt.
--inf-ruby-mode
Emacs inf-ruby compatibility.
-I PATH
Add to load path.
--help
Display help information.

CAVEATS

Requires Ruby installed. No persistent state. Consider pry for advanced features.

HISTORY

irb has been part of Ruby since early versions, created by Keiju Ishitsuka as the standard Ruby REPL.

SEE ALSO

ruby(1), pry(1), gem(1), bundle(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community