Reading a file using File.read

Hi,

File.read(VALID_PATH_TO_FILE) works on ruby console but not as a rails
application. I dont understand why it fails saying “No such file or
directory”. Even File.exist? returns false from rails application output
but returns true from rails console. It has readable permissions for the
current user , so that’s not an issue.
What might be the cause of this problem?

Are you using a relative path? You might just be in a different working
directory in your Rails app.

I think i understood the problem