Inside a ruby script, how do I get the path to the ruby interpreter?
Example script:
#!/path/to/ruby puts `#{RUBY_INTERPRETER_PATH} -e \"puts \'h
To get the path of the currently running ruby interpreter:
require 'rbconfig' RUBY_INTERPRETER_PATH = File.join(RbConfig::CONFIG["bindir"], RbConfig::CONFIG["RUBY_INSTALL_NAME"] + RbConfig::CONFIG["EXEEXT"])