You can open irb by typing irb inside a terminal window. Then you can write your Ruby code & press enter to run it. If you want to close irb you can type exit . You can enable the command history by creating an .
To start working with REPL environment of NODE; open up the terminal (in case of UNIX/LINUX) or the Command prompt (in case of Windows) and write node and press 'enter' to start the REPL. The REPL has started and is demarcated by the '>' symbol.
REPL stands as a read-execute-print loop or language shell. It's a simple interactive environment that takes inputs and evaluates them. For Rubyist, you probably very familiar with irb (Interactive Ruby Shell): $ irb.
You can start it by typing irb in your shell and hitting enter. Its name is short for “Interactive Ruby Shell”, and yes, it is another kind of shell: Just like the shell running in your terminal irb is also a program that interactively waits for you to type something, and hit enter.
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.
Use the irb
(Interactive Ruby Shell) command.
https://en.wikipedia.org/wiki/Interactive_Ruby_Shell
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With