From: William James Date: 2005-12-18T14:42:47+09:00 Subject: Re: New to coding, lost as hell Stephen None wrote: > I've been looking into coding for a while now and would really like to > start. Thanks to Google and a few friends I found Ruby and think it > would be an excellent place to start. > > I've installed ruby (It says it's Ruby 182-15, I'm sure it's outdated > now, since I did it several months back) and started to read through > several guides (Learning Ruby and Why's (poignant) guide to Ruby). But > the things don't match up to the stuff which comes with the Ruby > install, or it's aimed at a different OS. > > I'm currently running Windows 98 (I don't need any more, so no reason to > update) and the Ruby install comes with some documentation and FreeRIDE > and SciTE editor. It seems FreeRIDE is the thing to use for basic stuff. > So I open it and type in something basic (Print 'hello world') and run > it. > > Nothing runs when I do it. The terminal says "Cannot find file 'CMD' one of it components>. Check to ensure path and filename are correct and > that all required libraries are avaiable." and FreeRide's output view > says > > ">ruby C:\ruby\freeride\untitled1.rb > >exit". > > So really I'm getting no where really fast. For now, forget FreeRIDE and SciTE. All you need is the Ruby executable and a text file that contains your program. Open a DOS box and make sure that the directory containing ruby.exe is in your path. (Type "path".) If it isn't type something like path c:\bin\ruby\bin;%path% Move to the directory where your program file is by typing something like cd \myprogs\ruby Let's say your program is named "hello.rb". Type this: ruby hello.rb To run the program again, press the Up-arrow key once to recall the command line and then press Enter. That's all there is to it. The same method would work for programs in Awk, Python, Perl, etc. (except that Awk needs "-f", as in "awk -f hello.awk".) To make this easier in the future, put a Command Prompt icon on your desktop. Click on Start/Programs/Accessories and right-click on "Command Prompt"; select "Send to Desktop". (I'm using windoze 2000; you may have to alter this slightly for win98.) If your Ruby installer didn't put the Ruby directory in the path, then right-click on the Command Prompt icon, select "Properties" and add this at the end of the "Target:" line: /K c:\myDOSstartup.bat myDOSstartup.bat should be a text file containing a path command to add Ruby to the path and any DOSkey macros (aliases) that you want to use.