I have a program that tries to open a file:

```
Dir.chdir(File.dirname(__FILE__))
puts "Enter file name: ";
relPath = gets;
absPath = Dir.pwd << "/" << relPath;
if File.exist?(absPath) then
    puts "File exists";
    file = File.open(absPath, "r");
    other code...
else
    puts "File does not exist";
end

```

It always prints "File does not exist" even when the current directory exists and the file also exists. The file and script are in the same directory.

I am running it on Mac OS X Yosemite (10.10.3) and Ruby 2.2.0p0.