什么命令打开 Ruby 的 REPL?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13190138/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 05:30:29  来源:igfitidea点击:

What command opens Ruby's REPL?

rubyread-eval-print-loop

提问by Jian

What command opens Ruby's REPL?

什么命令打开 Ruby 的 REPL?

In Python, you simply open pythonwithout any arguments.

在 Python 中,您只需打开python而不带任何参数。

采纳答案by Jian

Use the irb(Interactive Ruby Shell) command.

使用irb(交互式 Ruby Shell)命令。

回答by J?rg W Mittag

There are several REPLs for Ruby.

Ruby 有几个 REPL。

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 rbxprogram without arguments, just like in CPython.

标准库附带了一个名为IRb(用于Interactive Ruby)的 REPL ,它安装了一个名为 的程序irb,但由于它只是一个 Ruby 库,它也可以从 Ruby 代码中调用,而不仅仅是从 shell 中调用。在Rubinius 上,IRb 也可以通过rbx不带参数调用程序来调用,就像在 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.

还有一个非常好的 REPL 叫做Pry,它安装了一个名为 的程序pry,但由于它只是一个 Ruby 库,它也可以从 Ruby 代码中调用,而不仅仅是从 shell 中调用。

JRubycomes with an additional REPL called JIRb Swing, which is invoked by calling the jirb_swingprogram.

JRuby附带了一个名为JIRb Swing的附加 REPL ,它通过调用jirb_swing程序来调用。

The NetBeansRuby Plugin also comes with a REPL.

NetBeans的Ruby的插件还带有一个REPL。