From: rashworth Date: 2001-03-18T06:56:53+09:00 Subject: [ruby-talk:12791] Re: Library packaging I have a different question: Subject: Simple Tk Application, page 153 in your Programming Ruby. What is the correct procedure to run this example? When I use "Run Ruby Program" the output window flashes open and then closes quickly. When I use the Ruby Interpreter (Ruby only icon), nothing happens on my PC with the Windows ME. I am using Ruby 1.6.1. Thank you. ERA ---------- Original Message ---------------------------------- From: Dave Thomas Reply-To: ruby-talk@ruby-lang.org Date: Sun, 18 Mar 2001 05:03:13 +0900 >matz@zetabits.com (Yukihiro Matsumoto) writes: > >> |I think there's a simpler solution to the original problem: add the >> |directory from which the main Ruby program was run to the search path >> |if SAFE is 0. So, if I say >> | >> | ruby ../../demo/fred.rb >> | >> |then '../../demo' will be prepended to $: >> >> This has been proposed several times (in Japanese list), but I >> couldn't find the portable and reliable way to get the base path of >> the executable file on UNIX flavored OS. Can you? > >I guess there are two cases: > > 1. When the program is run using: > > ruby > > Then you know the path, and all's well > > 2. When the program's run using a shebang line, then you may or may > not get the path to the .rb file included. On Linux, this > doesn't seem to be a problem. What's the status with other > Unices? > > >Dave >