variables - Error when opening Ruby File (Beginner) + How to run a file? -
when try open ruby file in same directory weird happens, :
c:\rubyfiles>file = file.open("lottery.rb", "r") 'file' not recognized internal or external command, operable program or batch file.
now know has nothing opening of file itself, wanted have example ;)
(this has been resolved^) :d
but know how run file itself? can help? in advance!
after opening irb, can execute ruby file using kernel#load
load 'lottery.rb'
if file includes module/class definitions, want load once. kernel#require
ensures:
require 'lottery.rb'
Comments
Post a Comment