From: Nate Wiger Date: 2006-10-25T03:37:16+09:00 Subject: Re: Getting path of current script ara.t.howard@noaa.gov wrote: > > just a note, what you have above is not the dir for the > current script, it's the dir for the current file - eg the > value will be the same whether the file is run or required/loaded. > for the current script you need > > path = File.dirname(File.expand_path($0)) > > or > > File.dirname($0) I think the main problem is that the second solution is not an abs path if you type "./script" or even "../../bin/script". Your first suggestion is what I would use personally. -Nate