Absolute Beginner - Where to run program?

Discussion in 'Ruby' started by MichaelCuculich@gmail.com, May 12, 2007.

  1. Guest

    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/quickstart/3/

    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
    , May 12, 2007
    #1
    1. Advertising

  2. On 5/12/07, <> 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/list.html
    A Look into Japanese Ruby List in English
    Harry Kakueki, May 12, 2007
    #2
    1. Advertising

  3. On 5/12/07, <> 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/quickstart/3/
    >
    > 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/list.html
    A Look into Japanese Ruby List in English
    Harry Kakueki, May 12, 2007
    #3
  4. Guest

    On May 11, 9:47 pm, 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/quickstart/3/
    >
    > 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.
    , May 12, 2007
    #4
  5. I suggest that you use eclipse.

    http://www.eclipse.org/

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

    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-forum.com/.
    Lloyd Linklater, May 12, 2007
    #5
  6. mully Guest

    mully, May 12, 2007
    #6
  7. Guest

    On May 12, 9:26 am, mully <> wrote:
    > On May 12, 12:47 am, 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.html#intro
    >
    > Hope that helps.
    >
    > Davidhttp://rubyonwindows.blogspot.com


    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! :)
    , May 12, 2007
    #7
  8. Tim Hunter Guest

    wrote:
    > On May 12, 9:26 am, mully <> wrote:
    >
    >> On May 12, 12:47 am, 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.html#intro
    >>
    >> Hope that helps.
    >>
    >> Davidhttp://rubyonwindows.blogspot.com
    >>

    >
    > 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.rubyforge.org]
    RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html]
    Tim Hunter, May 12, 2007
    #8
  9. Guest

    On May 12, 2:20 pm, wrote:
    > On May 12, 9:26 am, mully <> wrote:
    >
    >
    >
    > > On May 12, 12:47 am, 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.html#intro

    >
    > > Hope that helps.

    >
    > > Davidhttp://rubyonwindows.blogspot.com

    >
    > 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.
    , May 12, 2007
    #9
  10. mully Guest

    On May 12, 5:20 pm, wrote:

    > 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! :)


    Good question! I agree with zotobi that's it's definitely best to
    create a separate folder for your ruby scripts, outside your ruby
    install folder. This ensures that your scripts don't get blown away by
    changes to your ruby installation folder.

    I'll soon be posting a Ruby on Windows FAQ to my blog. You've asked
    good questions here, which I plan to include in that article.

    David

    http://rubyonwindows.blogspot.com
    mully, May 12, 2007
    #10
  11. John Joyce Guest

    On May 13, 2007, at 7:35 AM, mully wrote:

    > On May 12, 5:20 pm, wrote:
    >
    >> 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! :)

    >
    > Good question! I agree with zotobi that's it's definitely best to
    > create a separate folder for your ruby scripts, outside your ruby
    > install folder. This ensures that your scripts don't get blown away by
    > changes to your ruby installation folder.
    >
    > I'll soon be posting a Ruby on Windows FAQ to my blog. You've asked
    > good questions here, which I plan to include in that article.
    >
    > David
    >
    > http://rubyonwindows.blogspot.com
    >


    It's not only a Ruby issue, but organizing files is an interesting
    issue. There are many approaches. Notice how files are organized in
    the operating system. Windows and various *nix's organize things in
    various ways. Web sites as well tend to have a few different ways
    that files are commonly organized.
    So you may want to create a directory (folder) that holds all or most
    of the stuff you create for one language (such as RubyStuff).
    Then another for each grouping. So if you start working through
    exercises in a book on Ruby, create a directory just for that book's
    exercises. Directory tree structure is as important as anything else
    in planning a program. Rails for example has its own directory tree
    structure. It is a pretty well thought out one too. There are a few
    directories in Rails that are legacy things from older versions, but
    most of it makes a lot of sense once you start to get familiar with
    it. The environment (the OS and the way it is structured and the way
    it works) is as much a part of your programs as anything else!
    Just something to think about. It becomes more clear as you go along.
    Different kinds of projects demand different sensibilities in
    organization.
    John Joyce, May 13, 2007
    #11
  12. Bill Guindon Guest

    On 5/13/07, John Joyce <> wrote:
    >
    > On May 13, 2007, at 7:35 AM, mully wrote:
    >
    > > On May 12, 5:20 pm, wrote:
    > >
    > >> 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! :)

    > >

    >
    > It's not only a Ruby issue, but organizing files is an interesting
    > issue. There are many approaches. Notice how files are organized in
    > the operating system. Windows and various *nix's organize things in
    > various ways. Web sites as well tend to have a few different ways
    > that files are commonly organized.
    > So you may want to create a directory (folder) that holds all or most
    > of the stuff you create for one language (such as RubyStuff).
    > Then another for each grouping. So if you start working through
    > exercises in a book on Ruby, create a directory just for that book's
    > exercises. Directory tree structure is as important as anything else
    > in planning a program. Rails for example has its own directory tree
    > structure. It is a pretty well thought out one too. There are a few
    > directories in Rails that are legacy things from older versions, but
    > most of it makes a lot of sense once you start to get familiar with
    > it. The environment (the OS and the way it is structured and the way
    > it works) is as much a part of your programs as anything else!
    > Just something to think about. It becomes more clear as you go along.
    > Different kinds of projects demand different sensibilities in
    > organization.


    I completely agree with John. Over time, you'll probably end up with
    not only a Ruby directory, but subdirectories below it. Of course,
    you don't have to do that immediately, but you might want to.

    Personally, I like to have at least one 'junk' directory, a place
    where I drop small experiments that may one day become something
    useful, or that I can turn back to when I get hit with the same
    question months later. In the past, I've called it 'sandbox', or
    'playground', my current one is called 'anarchy' - it's where
    'anything goes' ;-)

    Some ideas:
    ruby\learning # 'primitive' stuff that beginners write.
    ruby\sandbox # useful examples, or test scripts.
    ruby\apps\someapp # when you actually have working apps
    ruby\quiz # if you do the quizes, you should group them, with a dir for each.

    --
    Bill Guindon (aka aGorilla)
    The best answer to most questions is "it depends".
    Bill Guindon, May 13, 2007
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Absolute Beginner

    , Sep 7, 2005, in forum: ASP .Net
    Replies:
    14
    Views:
    586
  2. Gux

    Absolute Beginner

    Gux, Dec 20, 2003, in forum: Java
    Replies:
    5
    Views:
    500
    Bob X
    Dec 21, 2003
  3. Replies:
    5
    Views:
    354
    BartlebyScrivener
    Aug 10, 2006
  4. News123
    Replies:
    8
    Views:
    480
    Tom Morris
    Dec 8, 2008
  5. James Byrne
    Replies:
    3
    Views:
    532
    James Byrne
    Sep 14, 2010
Loading...

Share This Page