I see this all the time in Ruby:
require File.dirname(__FILE__) + \"/../../config/environment\"
What does __FILE__ mean?
__FILE__
__FILE__ is the filename with extension of the file containing the code being executed.
In foo.rb, __FILE__ would be "foo.rb".
foo.rb
If foo.rb were in the dir /home/josh then File.dirname(__FILE__) would return /home/josh.
/home/josh
File.dirname(__FILE__)