Skip to content

Instantly share code, notes, and snippets.

@rjungemann
Created January 18, 2010 02:34
Show Gist options
  • Save rjungemann/279742 to your computer and use it in GitHub Desktop.
Save rjungemann/279742 to your computer and use it in GitHub Desktop.
Get the running script's absolute path
# The current "best way" to get the absolute path of the current script in Ruby,
# as far as I know....
require 'pathname'
$prefix = Pathname.new(File.dirname(__FILE__)).realpath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment