I suggest you work through a good tutorial (railstutorial.org is good
and is free to use online). I know this will be for a new application
but that will be the best way to learn the basics of rails. Having
done that then you will be able to understand what you have.
Also look at the Rails Guides online.
To find which version of rails the application expects then first look
in the file config/environment.rb where you may find a line
RAILS_GEM_VERSION = ...
If you do not see that file then there may be a file Gemfile in the
root of the project, in which case it should have a line gem 'rails',