nonopolarity
nonopolarity

Reputation: 151264

How do you tell the Rails version inside of a Rails app?

Up to Rails 2.3.8, there is a constant:

RAILS_GEM_VERSION   "2.3.8"

but Rails 3.0.0 doesn't have it. Is there other ways?

Upvotes: 4

Views: 346

Answers (1)

gaqzi
gaqzi

Reputation: 3807

Use Rails.version.

Most environment information that you might need from Rails should be accessible from that class.

The documentation.

Upvotes: 5

Related Questions