SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot lord's Avatar
    Join Date
    Nov 2003
    Location
    sLOVEnia
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    gets() <- nothing happens ... any ideas?

    Hello to all Ruby folks here

    I'm also in ruby fever. I got some pdf tutorials and start with the basic's.

    And at the start I have problem with method gets()
    When code come to this method cmd window is opened and waiting for some input. But I can't write anything, nothing happen when I press keys on my keyboard .. nothing happen when I hit enter.

    The only way is to kill window, and then I get meassage ">Exit code: -1073741510"

    Code:
    p ('Enter your name: ')
    name = gets()
    puts ( "Hello #{name}" )
    In theory i should write name and ruby put a Hello with my name that I input before

    Any ideas what is wrong?
    Thanx in advance

    p.s. using ruby 1.8 @ Win XP

  2. #2
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code is correct, maybe you should reinstall Ruby. Ruby One-Click Installer is easy and worked for me:

    http://rubyforge.org/projects/rubyinstaller/


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
  •