The most accurate way is probably to do a "gem list | grep rails".
"rails -v" will give you the version rails reports, but can be misleading for test versions (e.g. this will report 1.1.6 for the 1.2 release candidates, whereas "gem list" will tell you 1.1.6.5848).
-faisal