From: James Date: 2010-07-27T01:16:20+09:00 Subject: Re: basic beginner help needed --00221532cb905b3d39048c4cb455 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable > > Thank you all for your input. After reading the comments I took the > advice of reading the two on-line tutorials, so this is where I am now: > I have switched to a different computer that has the Windows XP > operating system, have installed Ruby 1.9.1 on it (with ruby.exe located > in =91C:\Ruby191\bin=92), I downloaded and installed the SciTE editor > recommended by Mr. Neighborly=92s Humble Little Ruby Book, and have been > successful in getting the SciTE editor to open scripts located in > =91C:\Documents and Settings\Karl Halvorson\My Documents\Ruby\My Ruby > Tutorial scripts=92. The tutorials with this editor started out fine, I > entered the text > > puts "Hello, World." > > Into the text editor, pressed go and got > > >ruby hello.rb > Hello, World. > >Exit code: 0 > > To me that looked like it worked the way it was supposed to. > Looks that way here, too. Good work! > I then went on to the next step and typed the following into the text > editor: > > puts "Hello, World. What is your name?" > myname =3D gets() > puts "Well, hello there " + myname + "." > > I was instructed to save the file again, so I did, as hello2.rb, and ran > it again from the editor by pressing go. What I returned in the right > pane of the editor was: > > >ruby hello2.rb > > Also, the Windows Command Prompt opened up with > =91C:\Ruby191\bin\ruby.exe=92 at the top in the menu bar, but nothing in = the > black screen except for a blinking cursor (see attached image1). I tried > typing in the black screen, but was unable to. The tutorial stated, =93yo= u > should see a greeting, be asked for your name, and then greeted by > name.=94 None of this happened. > > Any suggestions what to try next? > > Sure thing. I ran your code and saw the same output. So you're doing everything right, this is something with scite. I have no real idea what's happening to make the process hang, but a little research shows that it's related to the call to gets, and further research shows that this is a know= n problem with scite. There's a solution, though! Running the script from the command prompt will work fine. StartMenu -> All Programs -> Ruby191 -> "Start Command Prompt with Ruby" cd "C:\Documents and Settings\Karl Halvorson\My Documents\Ruby\My Ruby Tutorial scripts" Now run the script using ruby! Type: ruby "name of script" > Also, Phaneee5, could you explain, in beginner language (step-by-step) > what you mean by =93Setting the PATH environment variable to the ruby->bi= n > folder=94, for this is not covered in any of the biginning tutorials that > I have read? The part I really don=92t understand is =93Add this path to = the > PATH environment variable.=94 The path to ruby.exe on my computer is > =91C:\Ruby191\bin=92, but what exactly is the =91PATH environment variabl= e=92? > and how exactly do I add =91C:\Ruby191\bin=92 to it? > > Thank you all again for your help. > > http://support.microsoft.com/kb/310519 discusses environment variables, including the PATH. With the ruby windows installer, you get the shortcut that we used above to start a command prompt with the right environment for using ruby. However, if you want you set up your environment so that it's always correct for running ruby from the command line, so that you can use = a regular command prompt to run ruby programs instead of needing to use the specific shortcut that the installer gave you. --00221532cb905b3d39048c4cb455--