I installed Ruby 1.9.2 on my Win 7 machine. Created a simple analyzer.rb file. It has this one line:
analyzer.rb
File.open(\"text.txt\").each {|line| puts l
Ditto Casper's answer:
puts Dir.pwd
As soon as you know current working directory, specify the file path relatively to that directory.
For example, if your working directory is project root, you can open a file under it directly like this
json_file = File.read(myfile.json)