Ruby rails version

June 7, 2009 at 12:49 pm Leave a comment

The simplest way would be to just run this command:

ruby script/about

and you will get Ruby version, Rails version and much more. Another standard way to check the versions of both Ruby and Rails from the command line is:

Ruby -v
Rails -v

And if you want to check it from the code?

To check the Ruby on Rails version from the code you should access this Rails constant – Rails::VERSION::STRING

To test it, you can run the console “ruby script/console” and in the console prompt check the version constant “Rails::VERSION::STRING”

> script/console
Loading development environment.
>> Rails::VERSION::STRING
=> "2.3.0"
>> exit

PS. There also used to be a cool way to run the about script from the web on the development environment (somewhat similar to phpinfo()) by going to this page: http://127.0.0.1:3000/rails/info/properties, but it is seemingly deprecated in the latest Rails (in my 2.3.2 at least it doesn’t work) and it gives an error: No route matches “/rails/info/properties” with {:method=>:get}

Advertisements

Entry filed under: Uncategorized.

Building a user authorization system in PHP – Part II Great introduction to Ruby

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent posts

Starting to learn Rails?

Kindle

Get Kindle - the best e-book reader, that I personally use, and the only one that you can read on the beach - very useful: Kindle Wireless Reading Device (6" Display, Global Wireless, Latest Generation)

%d bloggers like this: