So I just installed ruby and I'm pretty sure I have it set up right, but when I try and run a .rb file typing "ruby" and then the file name in the cmd all I get is a blank space. Not even an error. The file is a simple beginners one that just says puts "hello world". My computer uses windows 8.
on 2014-06-20 02:54
on 2014-06-22 02:55
Did you resolved this? Can you give more information?
on 2014-06-22 18:32
No I have not resolved it yet. More details like what?
on 2014-06-22 19:14
Show us the code inside the file, and the exact command you're executing to run it. Without this information we cannot help you. My instinct says that you've wrapped your code up in a method and forgotten to call the method, but I can't tell that without seeing the code.
on 2014-06-22 20:46
No no method. Alls it says is: puts "hello" I was testing to see if it worked. I typed ruby hello.rb into command. The only output was that it seemed to skip a few lines. Just a blank black space. No errors.
on 2014-06-22 22:33
go to Start on lower left hand corner and type "cmd" then go to the correct folder that contain your hello.rb file then when u are in the folder that contain your hello.rb, u type "ruby hello.rb"
on 2014-06-22 22:34
to go between folders, cd "folder name withouth the double quotes" type dir to find the current listing in the current directory.
on 2014-06-22 23:28
I was in the correct folder. It didn't give me an error saying the file didn't exist. Though I didn't type the command in double quotes.
on 2014-06-23 00:25
>No no method. Alls it says is: >> puts >>"hello" The first line tells ruby to output the argument you supplied to puts(), followed by a carriage return(known as a 'newline' in computer programming). Because you didn't supply an argument to the puts() method, ruby just outputs the newline, which your terminal displays as a blank line. The second line tells ruby to create a String(that's what double quotes do), and because you didn't assign the String "hello" to a variable, it is discarded. Then your program ends. Any questions?
on 2014-06-23 01:09
Well that's all the tutorial told me to put. So then how would I type it to get it to display "hello" ? And thank you for the help.
on 2014-06-23 23:05
> Well that's all the tutorial told me to put. Do you have a link to the tutorial? > So then how would I type it > to get it to display "hello" Reread my explanation of your code: == The first line tells ruby to output the argument you supplied to puts(), followed by a carriage return(known as a 'newline' in computer programming). Because you didn't supply an argument to the puts() method... == Does that give you any ideas?
on 2014-06-24 02:55
Ahh...i get it. Everything shows up fine now. Thank you for your assistance in this matter.