
-----------------------------------
Thuged_Out_G
Wed Nov 02, 2005 3:27 am

help for a n00b!
-----------------------------------
just downloaded ruby. got this 'scite' compiler .... erm, how do i run the programs .... i understand a ruby file is a '.rb' file .... but how do you run the program?

-----------------------------------
[Gandalf]
Wed Nov 02, 2005 4:30 am


-----------------------------------
SciTe is not a compiler, it is an editor, learn the difference.  Ruby does not have a compiler, it is interpreted through (guess what) and interpreter.

To run the program (if it is already not set up for automatic interpreting on double-click) you need to use the command line.  In the folder where the source file is, type something like "ruby sourceFile.rb", I don't remember the specifics.

For more help, look here:
http://www.compsci.ca/v2/viewforum.php?f=59
or check IRC (irc.afternet.org #compsci.ca) where someone may help you:
http://www.afternet.org/component/option,com_chat/Itemid,60/

-----------------------------------
Tony
Wed Nov 02, 2005 11:40 am


-----------------------------------
go to your command line (start -> run -> cmd)

from there

ruby source_file.rb

or better yet

irb

for some interactive shell action :wink: 

N:\>irb
irb(main):001:0> puts "Hello Ruby!"
Hello Ruby!
=> nil
irb(main):002:0> exit

N:\>


-----------------------------------
Cervantes
Wed Nov 02, 2005 3:59 pm


-----------------------------------
"]SciTe is not a compiler, it is an editor, learn the difference.  
Right, but Scite can execute the code and display it in the output pane.  :D

Search around the menus (File, Edit..).  You might find it under Tools.

edit: But, don't let it steer you away from using irb.  irb will be your best friend.

-----------------------------------
Thuged_Out_G
Wed Nov 02, 2005 10:09 pm


-----------------------------------
this 'irb' ... could i type a whole program in there, and then execute it? or does it just go line by line type deal?

im new to all this, only other language i learned was turing. all this talk about ruby, figure i may aswell jump in lol

-----------------------------------
wtd
Wed Nov 02, 2005 10:25 pm


-----------------------------------
this 'irb' ... could i type a whole program in there, and then execute it? or does it just go line by line type deal?

A little of both.  :)

It will accept one piece of code that makes sense at a time.  This might be a single line of code, but it might be more than one line.

irb(main):001:0> 1 + 2
=> 3
irb(main):002:0> 1 +
irb(main):003:0*
irb(main):004:0* 2
=> 3
irb(main):005:0>

The other thing to keep in mind is that it remembers what has happened on previous lines.

irb(main):005:0> foo = 42
=> 42
irb(main):006:0> puts foo
42
=> nil
irb(main):007:0>

-----------------------------------
Clayton
Sat Jun 17, 2006 10:01 pm


-----------------------------------
how do you execute in SciTE though? i'm starting to learn Ruby (tired of Turing and its limitations) because ive heard many a good things about it, but i am unsure of how to run it :( (yes i have read the above posts, but could someone explain it in a bit more of step-by-step thing plz :D )

-----------------------------------
rdrake
Sat Jun 17, 2006 10:41 pm


-----------------------------------
how do you execute in SciTE though? i'm starting to learn Ruby (tired of Turing and its limitations) because ive heard many a good things about it, but i am unsure of how to run it :( (yes i have read the above posts, but could someone explain it in a bit more of step-by-step thing plz :D )As I recall, you press F5.
