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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -