Prior to Rails 2.3.8, there is a constant:
RAILS_GEM_VERSION "2.3.8"
but Rails 3.0.0 does not have this. Are there any other ways?
Use Rails.version .
Rails.version
Most of the environment information that can arise from Rails should be accessible from this class.
Documentation.