[英]what's the easiest way to setup a ruby/rails sandbox locally?
I like to play with dynamic programming languages before I get confident regarding their dynamic behaviors. 在对动态编程语言充满信心之前,我喜欢玩动态编程语言。 While there are online ruby sandbox sources available, I prefer to test it out locally.
虽然有可用的在线红宝石沙箱资源,但我还是希望在本地对其进行测试。
In javascript a html file with script tag is sufficient to write any sample javascript code. 在javascript中,带有script标签的html文件足以编写任何示例javascript代码。
What's the equivalent of forming this sandbox for ruby with...? 用...组成这个红宝石沙箱的等效方式是什么?
1. a boilerplate
2. manually setting up ruby sandbox (prefered)
If you just want a ruby sandbox $ irb
will do the trick. 如果您只想要一个红宝石沙盒,
$ irb
可以解决问题。
If you want a ruby on rails sand box $ rails c -s
short for $ rails console ––sandbox
. 如果您想在Rails沙盒上使用红宝石,则
$ rails c -s
是$ rails console ––sandbox
。
This command loads our Rails application, connects to the database and automatically starts a database transaction.
此命令加载我们的Rails应用程序,连接到数据库并自动启动数据库事务。 All database operations performed within this console session are rolled back upon leaving the console.
在离开控制台后,将回滚此控制台会话中执行的所有数据库操作。
Install ruby https://www.ruby-lang.org/en/documentation/installation/ 安装ruby https://www.ruby-lang.org/en/documentation/installation/
And use Interactive Ruby Shell(IRB) https://www.ruby-lang.org/en/documentation/quickstart/ 并使用Interactive Ruby Shell(IRB) https://www.ruby-lang.org/en/documentation/quickstart/
到目前为止,BitNami是本地安装最简单的设置: https : //bitnami.com/stack/ruby
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.