Sam
Sam

Reputation: 15761

Ruby on Windows Command Prompt

I am brand new to Ruby, and I have downloaded and installed it and added Ruby to my PATH.

I opened a new command prompt and typed Ruby, which put me into a session so to speak.

I then started to type various commands like, help, update, version etc and it did nothing.

I then tried exit, quit and cancel only to find that you have to use CTRL+C to interrupt.

Anyways, did I harm the installation in any way by typing in those random commands? I never received any feedback after I typed the commands, just dropped a new line.

Upvotes: 0

Views: 1030

Answers (2)

anthonybell
anthonybell

Reputation: 5998

ruby is the compiler I believe. irb is the interactive console.

If you do Ruby myRubyFile.rb it will run the file for you. This is useful in a batch script i have found.

for example if the ruby script renames some files and moves them somewhere you can put that in a bat or bash shell script.

Upvotes: 2

fengolly
fengolly

Reputation: 503

When you type

ruby

like that, you're pointing the Ruby interepreter at . . . nothing!

Make a file called hello_world.rb, and put this line into it:

puts "Hello, world!"

Then type

ruby hello_world.rb

and see what happens.

Upvotes: 1

Related Questions