When I try to do this (real code):
fh = File.new("a file name", "w")
fh_path = File.absolute_path(fh)
I get an undefined method `absolute_path' for File:Class (NoMethodError)
In the Ruby documentation is says: absolute_path is a method of File so I don’t understand this NoMethodError. Am I using the method wrong?
Check your Ruby version. The method
absolute_pathwas added in 1.9.1, it seems.