From: Edward Middleton Date: 2010-07-28T12:22:23+09:00 Subject: Re: Which Ruby is in use? On 07/28/2010 11:20 AM, Hassan Schroeder wrote: > On Tue, Jul 27, 2010 at 7:03 PM, Fabian Marin wrote: >> hope I did not misunderstand the question, but would this work?? >> >> %x{which $0} >> >> It seems too easy to work so I probably missed something :P > > Thanks, but > $ irb >>> %x{which $0} > => "/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