Ruby interpreter name -
possible duplicate:
how find ruby interpreter?
how running ruby 1.8 interpreter name in ruby (e.g. /usr/bin/ruby
), i.e. argv[0]
passed c main()
function. i'm not interested in $0
, because that's name of .rb
script file. i'm not interested in config::config
, because filled when ruby installed -- i'm interested in running now
.
let's suppose /usr/bin/ruby
symlink /usr/bin/ruby1.8
. how know if ruby script has been started /usr/bin/ruby1.8 myscript.rb
or /usr/bin/ruby myscript.rb
?
see how find ruby interpreter?
require 'rbconfig' ruby_interpreter_path = file.join(config::config["bindir"], config::config["ruby_install_name"] + config::config["exeext"])
if want ruby specific information check out ruby_*
constants
>> ruby_ ruby_copyright ruby_engine ruby_platform ruby_revision ruby_description ruby_patchlevel ruby_release_date ruby_version
Comments
Post a Comment