如何从终端运行Ruby代码?


Answers:


178

如果已安装Ruby,则

ruby yourfile.rb

yourfile.rb包含ruby代码的文件在哪里。

要么

irb

启动交互式Ruby环境,您可以在其中键入代码行并立即查看结果。


6
irb是我的解决方案
B Samedi

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.