<p>I see this all the time in Ruby:</p>

<pre><code>require File.dirname(__FILE__) + "/../../config/environment"  
</code></pre>

<p>What does <code>__FILE__</code> mean?</p>

It is a reference to the current file name. In the file
```
foo.rb
```
,
```
__FILE__
```
would be interpreted as
```
"foo.rb"
```
.
Edit:
Ruby 1.9.2 and 1.9.3 appear to behave a little differently from what Luke Bayes said in
his comment
. With these files:
```
```
# test.rb
puts __FILE__
require './dir2/test.rb'
```
```
```
```
# dir2/test.rb
puts __FILE__
```
```
Running
```
ruby test.rb
```
will output
```
```
test.rb
/full/path/to/dir2/test.rb
```
```