How do you say the version of Rails inside a Rails application?

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?

+4
source share
1 answer

Use Rails.version .

Most of the environment information that can arise from Rails should be accessible from this class.

Documentation.

+5
source

All Articles