# Rake: How to determine the Rails version?

**URL:** <https://www.ruby-forum.com/t/rake-how-to-determine-the-rails-version/60915>\
**Category:** Rails\
**Created:** [May 18, 2006, 3:24pm UTC](https://www.ruby-forum.com/t/rake-how-to-determine-the-rails-version/60915 "2006-05-18T15:24:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [May 18, 2006, 3:24pm UTC](https://www.ruby-forum.com/t/rake-how-to-determine-the-rails-version/60915/1 "2006-05-18T15:24:50Z")

</div>

Hi all

I’m learning to use Rake for migration etc.  
I wonder if there’s a way to determine the currently used Rails version,  
so e.g. when installing a new engine using Rake I could check if there’s  
a version used that’s older as needed and so abort the installation. You  
know what I mean? 😉

Thanks and greetings,  
Joshua

---

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [May 18, 2006, 3:34pm UTC](https://www.ruby-forum.com/t/rake-how-to-determine-the-rails-version/60915/2 "2006-05-18T15:34:48Z")

</div>

Hi Joshua

script/about will give you the rails version (guess there’s probably a  
way  
to retrieve that programmatically).

hth

Thibaut

---

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [May 18, 2006, 3:44pm UTC](https://www.ruby-forum.com/t/rake-how-to-determine-the-rails-version/60915/3 "2006-05-18T15:44:03Z")

</div>

Rails::VERSION::MAJOR  
Rails::VERSION::MINOR  
Rails::VERSION::TINY

Or for all three as a string:

Rails::VERSION::STRING

Tom
