From: "Roger B. Atkins" Date: 2010-01-01T09:01:41+09:00 Subject: Re: Path problems Thanks Darryl. The error message: >ruby Test2.rb >The system cannot find the file specified. I do not understand the code in your handy snippet. I do not recognize ".unshift" or "___FILE___". I am guessing I should substitute something in place of "___FILE___", but so far I have not found the right substitute. I have tried the complete path name, the file name, the directory name, and I get the same error message every time. I guess I will resort to closing the file and reopening it each time before I run the program, at least until I learn more. Thanks again. RBA . Darryl (gem dandy) Brown wrote: > On Dec 31, 4:14 pm, "Roger B. Atkins" wrote: > >> I am learning Ruby from scratch, using a beginner's book and have >> installed Ruby on my WIN Vista platform. This is my first use of >> Ruby-Talk. I hope the following questions/problems are within the scope >> > Hi Roger, > > 1) I've not seen Freeride distributed with the stock ruby > installation. > if you'd like to use it, it's here => http://rubyforge.org/frs/?group_id=31 > > My suggestion starting out would be to use Notepad++ > > > 2) For errors that you get while running, it is best to post the error > verbatim to get the best help as opposed to describing the error. > > $LOAD_PATH or $: can be set from with your program. A handy snippet to > add to the top of your programs is > > $:.unshift File.dirname(__FILE__) unless > $:.include? File.dirname(__FILE__) > > This will add the path of your file to the load path unless > it is already there. > > If you want to know what your load path is, open an irb session > and enter p $: > > > Have fun with Ruby, > > Darryl > > > > > > >> of Ruby-Talk: >> >> 1. The book says there should be two source/text editors, FreeRide and >> SciTE, but I only have SciTE. >> >> 2. Using SciTE, F5 or Tools/Go, results in an error message to the >> effect that the system can't find my source file. The only way I have >> found to run my program is from the command line, and then it only works >> if I use an old DOS path command, include the full path before the >> program name, or change to the directory in which the source file is >> located. Is there a way to set path from within SciTE? >> >> Thanks, >> RBA >> > > > >