[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Absolute Beginner - Where to run program?

MichaelCuculich

5/12/2007 4:47:00 AM

hello there,

i am an absolute beginner, so my question might seem rather silly. i
just installed ruby 186-25 using the windows installer- my computer is
windows xp.

my first step was to follow the "ruby in twenty minutes" tutorial. at
a certain point they tell you to close the fxri consule in order to
create a ruby program on a file. so far so good. they then tell you
to run the file by typing "ruby ri20min.rb"
here is the tutorial: http://www.ruby-lang.org/en/documentation/qui...

that is all fine, but my question is: where do you type that command
line?

another tutorial i was looking at said to find out what version you
have installed to type "ruby -v" in the shell - but what exact is the
shell? the unix shell? if i am using windows xp where do i find that
exactly?

i know this may be a really silly question, and i bet it's so simple
that they don't post this information anywhere. i'm almost
embarrassed to ask. but i'd appreciate a kick start here- thanks! :D

-m

13 Answers

Harry Kakueki

5/12/2007 5:04:00 AM

0

On 5/12/07, MichaelCuculich@gmail.com <MichaelCuculich@gmail.com> wrote:
> hello there,
>
> another tutorial i was looking at said to find out what version you
> have installed to type "ruby -v" in the shell - but what exact is the
> shell? the unix shell? if i am using windows xp where do i find that
> exactly?
>
Hi,

You can type 'ruby -v' in at the command prompt.
I think you can find that under Start-Accessories-Command prompt.
I'm on Japanese XP so I'm not sure of the exact English wording they use.

This window will allow you to type DOS commands and run ruby programs, etc.

Harry


--
http://www.kakueki.com/ruby...
A Look into Japanese Ruby List in English

Sherm Pendley

5/12/2007 5:08:00 AM

0

MichaelCuculich@gmail.com writes:

> that is all fine, but my question is: where do you type that command
> line?

Start Menu -> /Programs/Accessories/Command Prompt

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://...
Cocoa programming in Perl: http://camelbones.sourc...

Harry Kakueki

5/12/2007 5:15:00 AM

0

On 5/12/07, MichaelCuculich@gmail.com <MichaelCuculich@gmail.com> wrote:
> hello there,
>
>
> my first step was to follow the "ruby in twenty minutes" tutorial. at
> a certain point they tell you to close the fxri consule in order to
> create a ruby program on a file. so far so good. they then tell you
> to run the file by typing "ruby ri20min.rb"
> here is the tutorial: http://www.ruby-lang.org/en/documentation/qui...
>
> that is all fine, but my question is: where do you type that command
> line?
>
>
I'm not familiar with that tutorial, but have you already created your
file using notepad or some other editor?

To run the Ruby program, you will need to navigate to the directory
containing your file (ri20min.rb) and type 'ruby ri20min.rb'.


Harry

--
http://www.kakueki.com/ruby...
A Look into Japanese Ruby List in English

zotobi@gmail.com

5/12/2007 6:22:00 AM

0

On May 11, 9:47 pm, MichaelCucul...@gmail.com wrote:
> hello there,
>
> i am an absolute beginner, so my question might seem rather silly. i
> just installed ruby 186-25 using the windows installer- my computer is
> windows xp.
>
> my first step was to follow the "ruby in twenty minutes" tutorial. at
> a certain point they tell you to close the fxri consule in order to
> create a ruby program on a file. so far so good. they then tell you
> to run the file by typing "ruby ri20min.rb"
> here is the tutorial: http://www.ruby-lang.org/en/documentation/qui...
>
> that is all fine, but my question is: where do you type that command
> line?
>
> another tutorial i was looking at said to find out what version you
> have installed to type "ruby -v" in the shell - but what exact is the
> shell? the unix shell? if i am using windows xp where do i find that
> exactly?
>
> i know this may be a really silly question, and i bet it's so simple
> that they don't post this information anywhere. i'm almost
> embarrassed to ask. but i'd appreciate a kick start here- thanks! :D
>
> -m

What you need is the command prompt. If you can't find it with what
Sherm said, try going to Run (shortcut: Startbutton+R, the startbutton
on your keyboard) and typing in 'cmd' and hitting enter. That should
do it.

Lloyd Linklater

5/12/2007 6:34:00 AM

0

I suggest that you use eclipse.

http://www.ec...

Then, get the Ruby for Eclipse add ons:
http://www-128.ibm.com/developerworks/opensource/library/os-ru...

Then, run eclipse. In the menu go to
window->preferences->ruby->installed interpreters. Click add and point
to the ruby directory.

Then, write a simple program. You might copy and paste this one to start
with:

10.times {puts 'Lloyd is the greatest!'}

and hit the run button. It is ever so much better than "Hello world."

--
Posted via http://www.ruby-....

Christian Luginbuehl

5/12/2007 1:28:00 PM

0

> that is all fine, but my question is: where do you type that command
> line?

First of all, let me say that the following terms you might find in
tutorials or books all mean basically the same: Command line, Command
Prompt, DOS Prompt, Terminal, Shell, Console and probably a few more.

Another thing: If you installed from the One-Click-Installer you also
should have the file extension .rb been associated with the ruby
interpreter. This means if you double-click of a file (let's say
'test.rb') it will automatically open a Command Prompt and run ruby on
your file (with the command 'ruby test.rb') in the directory it is
saved. If your Command Prompt opens and directly closes and you can't
see the output of your program this means that your program has
terminated and therefore the Command Prompt was closed. To avoid that
you can tell somewhere (I can't remember where - I'm running Linux here)
to let you close the window manually or simply put a 'gets' at the end
of your source file ('test.rb'). This is a method that asks for user
input via the keyboard and therefore your program won't close until you
hit the <Return> key.


Cheers,

Christian Luginbuehl

David Mullet

5/12/2007 4:26:00 PM

0

On May 12, 12:47 am, MichaelCucul...@gmail.com wrote:

>
> that is all fine, but my question is: where do you type that command
> line?
>
> -m

As Sherm mentioned, you'll want to open a command/console window.
You'll find further details on the Windows Command Prompt here...

http://www.bleepingcomputer.com/tutorials/tutorial76....

Hope that helps.

David
http://rubyonwindows.bl...

MichaelCuculich

5/12/2007 9:21:00 PM

0

On May 12, 9:26 am, mully <david.mul...@gmail.com> wrote:
> On May 12, 12:47 am, MichaelCucul...@gmail.com wrote:
>
>
>
> > that is all fine, but my question is: where do you type that command
> > line?
>
> > -m
>
> As Sherm mentioned, you'll want to open a command/console window.
> You'll find further details on the Windows Command Prompt here...
>
> http://www.bleepingcomputer.com/tutorials/tutorial76....
>
> Hope that helps.
>
> Davidhttp://rubyonwindows.bl...

found it! thanks to all! :)
when creating these ruby files, is there a specific place that you
should put them and/pr run them from? in other words, when i create
this sample ruby program, should i just put it in the C:/ruby folder?
or is it better "form" to create a folder for them, etc.? just
wondering...
in any case, thanks! :)

Tim Hunter

5/12/2007 9:47:00 PM

0

MichaelCuculich@gmail.com wrote:
> On May 12, 9:26 am, mully <david.mul...@gmail.com> wrote:
>
>> On May 12, 12:47 am, MichaelCucul...@gmail.com wrote:
>>
>>
>>
>>
>>> that is all fine, but my question is: where do you type that command
>>> line?
>>>
>>> -m
>>>
>> As Sherm mentioned, you'll want to open a command/console window.
>> You'll find further details on the Windows Command Prompt here...
>>
>> http://www.bleepingcomputer.com/tutorials/tutorial76....
>>
>> Hope that helps.
>>
>> Davidhttp://rubyonwindows.bl...
>>
>
> found it! thanks to all! :)
> when creating these ruby files, is there a specific place that you
> should put them and/pr run them from? in other words, when i create
> this sample ruby program, should i just put it in the C:/ruby folder?
> or is it better "form" to create a folder for them, etc.? just
> wondering...
> in any case, thanks! :)
>
>
>
I would keep them separate from the Ruby files themselves. You may need
to delete that directory for some reason or upgrade Ruby and you don't
want to run the risk of erasing all your Ruby programs.

I keep my Ruby programs in C:\rb.

--
RMagick [http://rmagick.rub...]
RMagick Installation FAQ [http://rmagick.rub.../install-faq.html]


zotobi@gmail.com

5/12/2007 9:53:00 PM

0

On May 12, 2:20 pm, MichaelCucul...@gmail.com wrote:
> On May 12, 9:26 am, mully <david.mul...@gmail.com> wrote:
>
>
>
> > On May 12, 12:47 am, MichaelCucul...@gmail.com wrote:
>
> > > that is all fine, but my question is: where do you type that command
> > > line?
>
> > > -m
>
> > As Sherm mentioned, you'll want to open a command/console window.
> > You'll find further details on the Windows Command Prompt here...
>
> >http://www.bleepingcomputer.com/tutorials/tutorial76....
>
> > Hope that helps.
>
> > Davidhttp://rubyonwindows.bl...
>
> found it! thanks to all! :)
> when creating these ruby files, is there a specific place that you
> should put them and/pr run them from? in other words, when i create
> this sample ruby program, should i just put it in the C:/ruby folder?
> or is it better "form" to create a folder for them, etc.? just
> wondering...
> in any case, thanks! :)

Probably better to put it in a separate folder from your ruby
installation just to keep things neat and clear.