SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: 1 hr into Ruby

  1. #1
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    1 hr into Ruby

    How do I make my XP console window not close so fast?

    Very basic yes, but I've looked high & low... TIA.

  2. #2
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What are you doing with it? The console window will close once the program that oppened it finishes running. But if you go to start -> run -> cmd then it'll stay open until you close it... you can just run the programs from there.

  3. #3
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm running the very basic 2 or 3 line prgs just to get a feel for Ruby and since the console closes right away, I'm not learning anything. Unless there is a Ruby cmd that I can use with each .rb or a Ruby (or Windows) setting that I can use to keep the console window open, how do I see the output? TIA.

  4. #4
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How are you running them? To run .rb files I do ths ina command prompt:
    Code:
    ruby bla.rb
    That would keep it open. But if I double click a RB file, the command prompt will close immediately after the program finishes executing (as it should).

  5. #5
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see, I was running from the Explorer window, it does as you said from the console though, thx.

  6. #6
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This window:

    Code:
    puts "Hello World!"
    gets
    Will not close until you press [enter].

  7. #7
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not use interactive ruby to try out a few lines of code?

    Start > Run > Cmd

    At the prompt, type 'irb' then hit enter

  8. #8
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes that'd be good but I got the impressoin here that he was just trying to run a ruby application...

  9. #9
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Homan
    Why not use interactive ruby to try out a few lines of code?
    Start > Run > Cmd
    At the prompt, type 'irb' then hit enter
    This is the Cadillac of programming language learning.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •