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
These days (1.9+) you can use built-in methods (which are supposed to work with Jruby, etc.) like this:
RbConfig.ruby or Gem.ruby
$ irb --simple-prompt >> RbConfig.ruby => "C:/installs/Ruby193/bin/ruby.exe" >> Gem.ruby => "C:/installs/Ruby193/bin/ruby.exe"