Possible Duplicate:
How do I find the ruby interpreter?
How do I get the currently running Ruby 1.8 interpreter name in Ruby (e.g. /usr/bin/ruby), i.e. the argv[0] passed to the C main() function. I'm not interested in $0, because that's the name of the .rb script file. I'm also not interested in Config::CONFIG, because that was filled when Ruby was installed -- but I'm interested in where it is running now.
Let's suppose /usr/bin/ruby is a symlink to /usr/bin/ruby1.8. How do I get to know if my Ruby script has been started as /usr/bin/ruby1.8 myscript.rb or /usr/bin/ruby myscript.rb?