From: Joel VanderWerf Date: 2004-01-06T08:23:43+09:00 Subject: Re: name of current ruby iterpreter Ryan Pavlik wrote: > On Tue, 6 Jan 2004 07:20:08 +0900 > Joel VanderWerf wrote: > > >>Ryan Pavlik wrote: > > > >>> require 'rbconfig' >>> >>> ruby = Config::CONFIG.fetch('bindir') + "/" + >>> Config::CONFIG.fetch('RUBY_INSTALL_NAME') >>> ruby = Config.expand(ruby) >>> >>> exec ruby, "-e", 'puts VERSION' >> >>Almost there. It won't work if you've got 1.8.0 and 1.8.1 both >>installed (if you installed 1.8.1 later, requiring 'rbconfig' >>generates an error). > > > Maybe installing one over the other... that's not a good thing. I > suggest using Encap. ;-) But it works fine with 1.8.1 here. Good idea...I've been meaning to lear encap or stow. But your suggestion works with 1.8.1 here, also (I guess since that's the last installed version), so I'm happy.