Forum: Ruby Can Not Get Ruby to Run in Windows CMD Window

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Brad (Guest)
on 2007-02-03 15:25
(Received via mailing list)
Hi All,

As the subject says.."Can Not Get Ruby to Run in Windows CMD Window"

I have Ruby installed: C:\Ruby

I was reading the Programming Ruby - The Pragmatic Programmers'
Guide.  It says to bring up the Shell Prompt and type Ruby, then puts
"Hello World"

When I type Ruby <enter> puts "Hello World" nothing happens.  What am
I doing wrong?

Thank you.

Brad
Kiran Kumar K (Guest)
on 2007-02-03 15:33
(Received via mailing list)
Type Ctrl+Z after that and you would get the output. I would recommed
that
you type your programme in an editor and then run them using

c:\> ruby yourprogramfile.rb

The best way however if you would like to learn ruby is use Interactive
Ruby
(IRB). Typing *irb* at the command prompt would give you the IRB shell.
_Kevin (Guest)
on 2007-02-03 16:55
(Received via mailing list)
On Feb 3, 9:21 am, "Brad" <bradask...@gmail.com> wrote:
> When I type Ruby <enter> puts "Hello World" nothing happens.  What am
> I doing wrong?
>
> Thank you.
>
> Brad

the ruby executable reads from stdin (and is totally silent) until you
send it a ctrl-D, I think.  At that point it will process the text you
typed in.

_Kevin
B5c492685b72ea664bdda295053d819f?d=identicon&s=25 David M. (mully)
on 2007-02-03 17:25
(Received via mailing list)
On Feb 3, 9:21 am, "Brad" <bradask...@gmail.com> wrote:
> When I type Ruby <enter> puts "Hello World" nothing happens.  What am
> I doing wrong?
>
> Thank you.
>
> Brad

In addition to what Kevin said, keep in mind that "ruby" runs the Ruby
interpreter, while "irb" runs the interactive ruby interpreter.

Mully
This topic is locked and can not be replied to.