134

What command opens Ruby's REPL?

In Python, you simply open python without any arguments.

0

2 Answers 2

125

There are several REPLs for Ruby.

The standard library ships with a REPL called IRb (for Interactive Ruby), which installs a program named irb, but since it is just a Ruby library, it can also be invoked from Ruby code and not just from the shell. On Rubinius, IRb can also be invoked by just calling the rbx program without arguments, just like in CPython.

There is also a very nice REPL called Pry, which installs a program named pry, but since it is just a Ruby library, it can also be invoked from Ruby code and not just from the shell.

JRuby comes with an additional REPL called JIRb Swing, which is invoked by calling the jirb_swing program.

The NetBeans Ruby Plugin also comes with a REPL.

2
  • Should this be marked as answer for giving multiple REPLs?
    – Pdnell
    Commented Jan 31, 2016 at 23:29
  • 1
    I like this answer but you could make the default answer (irb) stand out more and then mention the other examples.
    – joh-mue
    Commented Aug 22, 2019 at 13:52
121

Use the irb (Interactive Ruby Shell) command.

https://en.wikipedia.org/wiki/Interactive_Ruby_Shell

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.