如何运行 ruby 文件? [英] How to run ruby files?
本文介绍了如何运行 ruby 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如我有文件 test.rb:
Example I have the file test.rb:
puts "test test test"
如何在 ruby 控制台中运行此文件?
How do I run this file in the ruby console?
推荐答案
load 'test.rb'
你是说 Rails 控制台吗?(同样的事情,但问题被标记为 rails.)
Do you mean Rails console? (Same thing, but the question is tagged rails.)
这篇关于如何运行 ruby 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文