From: Sam Morrison Date: 2007-07-27T22:20:04+09:00 Subject: Re: Getting Ruby Path at runtime? ------=_Part_5812_27578892.1185542408239 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/27/07, Ronald Fischer wrote: > > Is it possible to find out under Windows, which Ruby has been used to > run a program? > Example: A program is invoked by > > C:\inst\ruby186\bin\ruby.exe appl.rb > > Is it then possible to find out inside appl.rb the whole path > > C:\inst\ruby186\bin\ruby.exe > > ? If not, is it at least possible to find out > > - the Ruby version (1.8.6) and > - whether it is executed by Ruby or JRuby? You can do a check for the JRUBY_VERSION constant. If it exists then you are using jruby. -- sam ------=_Part_5812_27578892.1185542408239--