From: John Carter Date: 2009-04-20T10:44:38+09:00 Subject: Re: Which ruby is running me? On Mon, 20 Apr 2009, James Gray wrote: > On Apr 19, 2009, at 6:45 PM, John Carter wrote: > >> What is the One True Way of finding the path to _the_ instance of ruby >> that is currently executing this script? > > I'm pretty sure this always works: > > $ ruby -r rbconfig -e 'p File.join(Config::CONFIG.values_at(*%w[bindir > ruby_install_name])) + Config::CONFIG["EXEEXT"]' > "/usr/local/bin/ruby" Thanks! Ooo.. a tad ugly though... Ah, well, at least I wasn't missing the obvious for a change. :-) John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : john.carter@tait.co.nz New Zealand