# You can get current directory (directory of current file) with this
File.dirname(__FILE__)
# You can then join it with relative path to the root
File.join(File.dirname(__FILE__), '../../')
# Or you can use expand_path to convert relative path to absolute.
File.expand_path('../../Gemfile', File.dirname(__FILE__))