IRB(1)
π IRB(1) β the Ruby Programmer's Reference Guide page, but make it a group chat π
okay bestie, so this is the manual page for irb β literally the interactive Ruby shell, the place where you and Ruby just vibe together in real time. she's part of the Ruby Programmer's Reference Guide, she's been holding it down forever, and she's about to be your new favorite hangout. no cap. πΈ
β¨ NAME β¨
irb β Interactive Ruby Shell. that's it, that's the name, she's iconic π
π¦ SYNOPSIS π¦
the whole vibe in one shot, no skips:
irb [--version] [-dfUw] [-I directory] [-r library]
[-E external[:internal]] [-W[level]] [--[no]inspect]
[--[no]multiline] [--[no]singleline] [--[no]echo] [--[no]colorize]
[--[no]autocomplete] [--[no]verbose] [--prompt mode]
[--prompt-mode mode] [--inf-ruby-mode] [--simple-prompt]
[--noprompt] [--tracer] [--back-trace-limit n] [--] [program_file]
[argument ...]
π DESCRIPTION π
irb is the REPL (that's read-eval-print loop, bestie β read it, evaluate it, print it, loop it, over and over like your favorite playlist) environment for Ruby programs. you type Ruby, Ruby talks back, y'all go back and forth forever. main character energy fr fr β¨
π OPTIONS π
every single one, no gatekeeping:
--versionβ prints the version ofirb. the "hi what's your sign" of flags.-E external[:internal],--encoding external[:internal]β same asruby -E. sets the default value(s) for external encodings and internal encoding. separate those values with a colon (:).- you can totally omit the internal encoding one, and then the value (
Encoding.default_internal) will benil. ghosted, basically.
- you can totally omit the internal encoding one, and then the value (
-I pathβ same asruby -I. specifies$LOAD_PATHdirectory.-Uβ same asruby -U. sets the default value for internal encodings (Encoding.default_internal) toUTF-8.-dβ same asruby -d. sets$DEBUGtotrue.-fβ suppresses read of~/.irbrc. like airplane mode for your config file π«-wβ same asruby -w.-Wβ same asruby -W.-h,--helpβ prints a summary of the options. the "just tell me what's going on" button.-r libraryβ same asruby -r. causesirbto load the library usingrequire.--inspectβ usesinspectfor output (default except for bc mode).--noinspectβ doesn't useinspectfor output.--multilineβ uses multiline editor module.--nomultilineβ doesn't use multiline editor module.--singlelineβ uses singleline editor module.--nosinglelineβ doesn't use singleline editor module.--extra-doc-dirβ add an extra doc dir for the doc dialog.--echoβ show result (default).--noechoβ don't show result.--echo-on-assignmentβ show result on assignment.--noecho-on-assignmentβ don't show result on assignment.--truncate-echo-on-assignmentβ show truncated result on assignment (default).--colorizeβ use colorization. aesthetic β--nocolorizeβ don't use colorization.--autocompleteβ use autocompletion. she finishes your sentences, and honestly? she's right.--noautocompleteβ don't use autocompletion.--verboseβ show details.--noverboseβ don't show details.--prompt mode,--prompt-mode modeβ switch prompt mode. the pre-defined prompt modes aredefault,simple,xmpandinf-ruby.--inf-ruby-modeβ uses prompt appropriate for inf-ruby-mode on emacs. suppresses--multilineand--singleline.--simple-promptβ makes prompts simple.--nopromptβ no prompt mode.--tracerβ displays trace for each execution of commands.--back-trace-limit nβ displays backtrace top n and tail n. the default value is 16.
π ENVIRONMENT π
IRBRC- also
irbdepends on same variables asruby(1). so go read that one too, iykyk.
π FILES π
~/.irbrcβ personalirbinitialization. your little home-cooked setup, your secret sauce π«Ά
β EXAMPLES β
a whole conversation, look how cute she is:
% irb
irb(main):001:0> 1 + 1
2
irb(main):002:0> def t(x)
irb(main):003:1> x + 1
irb(main):004:1> end
=> :t
irb(main):005:0> t(3)
=> 4
irb(main):006:0> if t(3) == 4
irb(main):007:1> p :ok
irb(main):008:1> end
:ok
=> :ok
irb(main):009:0> quit
%
she said => :t, she said :ok, she said goodbye with quit. a full arc. ate and left no crumbs π₯
πΈ SEE ALSO πΈ
ruby(1). your other bestie.
π REPORTING BUGS π
listen, this part is serious, so pay attention bestie:
- Security vulnerabilities should be reported via an email to
security@ruby-lang.org. Reported problems will be published after being fixed. - Other bugs and feature requests can be reported via the Ruby Issue Tracking System (
https://bugs.ruby-lang.org/). Do not report security vulnerabilities via this system because it publishes the vulnerabilities immediately. that's a whole leak situation, do not do it π
π AUTHORS π
Written by Keiju ISHITSUKA. thank you for your service, legend π
and that's the page!! this came out of the UNIX manual set, version dated August 11, 2019, filed under IRB(1) β so if you ever need to cite her, that's the receipt. go forth and REPL, bestie, you're gonna slay πβ¨π¦π
π¦ where this page comes from
- debian bookworm: ruby3.1 3.1.2-7+deb12u1 Β· BSD-2-Clause OR Ruby
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms