# What version of rails am I running?

**URL:** <https://www.ruby-forum.com/t/what-version-of-rails-am-i-running/158069>\
**Category:** Rails\
**Created:** [January 19, 2009, 1:24am UTC](https://www.ruby-forum.com/t/what-version-of-rails-am-i-running/158069 "2009-01-19T01:24:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kedarmhaswade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@kedarmhaswade](https://www.ruby-forum.com/u/kedarmhaswade)\
**Post date:** [January 19, 2009, 1:24am UTC](https://www.ruby-forum.com/t/what-version-of-rails-am-i-running/158069/1 "2009-01-19T01:24:49Z")

</div>

Sorry to ask a question that appears like the one posed by a n00b.  
(Maybe I am going blind, seriously).

I have searched the forum for it, but couldn’t find it.

How can I tell which version of rails I am running? Doing “rails -v”  
fails. That’s another question – why does it fail – why can’t it tell  
me the version string?

-Kedar

---

<div class="post-metadata">

**Author:** ![kedarmhaswade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@kedarmhaswade](https://www.ruby-forum.com/u/kedarmhaswade)\
**Post date:** [January 19, 2009, 1:55am UTC](https://www.ruby-forum.com/t/what-version-of-rails-am-i-running/158069/2 "2009-01-19T01:55:12Z")

</div>

On 19 Jan 2009, at 00:24, Kedar M. wrote:

> 

In what way does it fail ?  
That aside, rails -v tells you what the latest version of rails on  
your computer is, which isn’t the same thing as what version your  
rails apps are running.  
That can be controlled by

- having RAILS\_GEM\_VERSION set to something in environment.rb
- having rails frozen into vendor/rails

when you run script/console or script/server it should tell you what  
version of rails its loading.

Fred

---

<div class="post-metadata">

**Author:** ![kedarmhaswade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@kedarmhaswade](https://www.ruby-forum.com/u/kedarmhaswade)\
**Post date:** [January 19, 2009, 2:13am UTC](https://www.ruby-forum.com/t/what-version-of-rails-am-i-running/158069/3 "2009-01-19T02:13:42Z")

</div>

Frederick C. wrote:

> On 19 Jan 2009, at 00:24, Kedar M. wrote:
> 
> > 
> 
> In what way does it fail ?  
> That aside, rails -v tells you what the latest version of rails on  
> your computer is, which isn’t the same thing as what version your  
> rails apps are running.  
> That can be controlled by
> 
> - having RAILS\_GEM\_VERSION set to something in environment.rb
> - having rails frozen into vendor/rails
> 
> when you run script/console or script/server it should tell you what  
> version of rails its loading.
> 
> Fred

Thank you. But I don’t think rails -v works. I think I have rails 2.0.2  
or something like that (and that’s what I am trying to ascertain) but on  
my Ubuntu here is what happens:  
kedar@kedar-laptop:~/Projects/ror/people$ which rails  
/usr/bin/rails  
kedar@kedar-laptop:~/Projects/ror/people$ rails -v  
getopt: invalid option – v  
Terminating…

-Kedar

---

<div class="post-metadata">

**Author:** ![kedarmhaswade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@kedarmhaswade](https://www.ruby-forum.com/u/kedarmhaswade)\
**Post date:** [January 19, 2009, 2:20am UTC](https://www.ruby-forum.com/t/what-version-of-rails-am-i-running/158069/4 "2009-01-19T02:20:21Z")

</div>

Hi there Kedar,

Try script/about or, alternatively you can do a gem list. If you have  
only one version of rails installed gem list will indicate this.

HTH,  
Schalk

---

<div class="post-metadata">

**Author:** ![kedarmhaswade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@kedarmhaswade](https://www.ruby-forum.com/u/kedarmhaswade)\
**Post date:** [January 19, 2009, 2:40am UTC](https://www.ruby-forum.com/t/what-version-of-rails-am-i-running/158069/5 "2009-01-19T02:40:49Z")

</div>

To go one step farther, I would recommend installing RubyGems from  
source and then installing Rails through RubyGems. Much better  
situation.

On Jan 18, 7:24 pm, “Jeremy McAnally” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![kedarmhaswade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@kedarmhaswade](https://www.ruby-forum.com/u/kedarmhaswade)\
**Post date:** [January 19, 2009, 2:25am UTC](https://www.ruby-forum.com/t/what-version-of-rails-am-i-running/158069/6 "2009-01-19T02:25:01Z")

</div>

Yes, Ubuntu puts their own Rails binscript (written in _bash_. ugh!)  
in there because apparently they hate you and the whole of the Rails  
community for some reason.

Try something like “rails --version”. And file a bug with Ubuntu  
because they’re the ones who maintain their stupid script.

–Jeremy

On Sun, Jan 18, 2009 at 7:13 PM, Kedar M.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > - having RAILS\_GEM\_VERSION set to something in environment.rb  
> > kedar@kedar-laptop:~/Projects/ror/people$ which rails

–  
[http://jeremymcanally.com/](http://jeremymcanally.com/)  
[http://entp.com/](http://entp.com/)

> **[Omg GIFs | GIFDB.com](https://gifdb.com/omg)**
>
> Download Omg GIFs for Free on GifDB. More than 56 Omg Animated GIFs to download.

My books:

> **[Ruby in Practice](https://www.manning.com/books/ruby-in-practice)**
>
> Like Ruby itself, Ruby in Practice will make you more productive. The book shows you practical techniques and strategies for small projects and large-scale environments. A cookbook-style reference, it gives you concrete examples of systems...

[http://humblelittlerubybook.com/](http://humblelittlerubybook.com/) (FREE!)

---

<div class="post-metadata">

**Author:** ![kedarmhaswade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@kedarmhaswade](https://www.ruby-forum.com/u/kedarmhaswade)\
**Post date:** [January 19, 2009, 4:20am UTC](https://www.ruby-forum.com/t/what-version-of-rails-am-i-running/158069/7 "2009-01-19T04:20:17Z")

</div>

Bobnation wrote:

> To go one step farther, I would recommend installing RubyGems from  
> source and then installing Rails through RubyGems. Much better  
> situation.
> 
> On Jan 18, 7:24ï¿½pm, “Jeremy McAnally” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Maybe then [http://wiki.rubyonrails.org/rails/pages/Installation](http://wiki.rubyonrails.org/rails/pages/Installation) should  
prefer RubyGems installation to “apt-get install ruby” (i.e. swap the  
order).

-Kedar

---

<div class="post-metadata">

**Author:** ![kedarmhaswade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@kedarmhaswade](https://www.ruby-forum.com/u/kedarmhaswade)\
**Post date:** [January 19, 2009, 4:00pm UTC](https://www.ruby-forum.com/t/what-version-of-rails-am-i-running/158069/8 "2009-01-19T16:00:24Z")

</div>

Kedar M. wrote:

> Bobnation wrote:
> 
> > To go one step farther, I would recommend installing RubyGems from  
> > source and then installing Rails through RubyGems. Much better  
> > situation.
> > 
> > On Jan 18, 7:24ï¿½pm, “Jeremy McAnally” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> Maybe then [http://wiki.rubyonrails.org/rails/pages/Installation](http://wiki.rubyonrails.org/rails/pages/Installation) should  
> prefer RubyGems installation to “apt-get install ruby” (i.e. swap the  
> order).
> 
> -Kedar

I think Ubuntu screws this up further because apparently their rails  
script does not identify -d mysql to mean database to use. Instead, it  
treats it as a folder, apparently, for example, if I did:  
$\> rails -d mysql people =\> this rails is from apt-get  
install rails

I get two folders created: “mysql” and “people”.

Instead, if I installed RubyGems and did gem update --system and then  
used the rails from there, it works better. Unfortunately, this rails  
script is located in /var/lib/gems/1.8/bin and the Ubuntu (faulty)  
script is in /usr/bin. So, I need to use /var/lib/gems/1.8/bin/ before  
/usr/bin in my PATH!

I think the community should be aware of this.

Thank you!  
-Kedar
