From: Fabian Marin Date: 2010-07-28T13:22:55+09:00 Subject: Re: Which Ruby is in use? Edward Middleton wrote: > On 07/28/2010 11:20 AM, Hassan Schroeder wrote: >> => "/bin/sh\n" >> >> isn't what I was looking for :-) > > Thats because the $0 is being evaluated by the shell not ruby. What you > actually want is %x{which #{$0}} which will give "which irb" to the > shell. If the PATH environment is the same this should give you the > full path. > > Edward Yeah I missed that. I could not execute/test the code I suggested because I'm using Win XP right now, sigh... Edward, you're right. Once $0 is evaluated by Ruby that should work in a Unix environment. -- Posted via http://www.ruby-forum.com/.