在本地设置 ruby/rails 沙箱的最简单方法是什么?

what's the easiest way to setup a ruby/rails sandbox locally?

在我对它们的动态行为有信心之前,我喜欢使用动态编程语言。虽然有可用的在线 ruby 沙箱资源,但我更愿意在本地进行测试。

在 javascript 中,带有脚本标签的 html 文件足以编写任何示例 javascript 代码。

用...为 ruby 构建这个沙箱相当于什么?

1. a boilerplate
2. manually setting up ruby sandbox (prefered)

如果您只想要一个 ruby 沙盒 $ irb 就可以了。

如果你想要 rails 沙盒 $ rails c -s 上的 ruby $ rails console ––sandbox 的缩写。

This command loads our Rails application, connects to the database and automatically starts a database transaction. All database operations performed within this console session are rolled back upon leaving the console.

安装rubyhttps://www.ruby-lang.org/en/documentation/installation/

并使用交互式 Ruby Shell(IRB) https://www.ruby-lang.org/en/documentation/quickstart/

BitNami 是迄今为止最简单的本地安装设置: https://bitnami.com/stack/ruby