Rails_root

Hello everybody:
I am new and i have a small problem with ruby. I want to execute an
external program and I need to pass as an argument to that program a
file of the system.
I’ve got that file in the public/files folder of my rails folder tree.
How can I know the path to where I have my rails project? I thought this
would be with RAILS_ROOT but this variable is “script/…/config/…” (I
have seen it with logger.debug("RAILS_ROOT is " + “#{RAILS_ROOT}”).