0
Parsing documentation for bundler-1.3.2
Installing ri documentation for bundler-1.3.2
Parsing documentation for rails-3.2.12
Installing ri documentation for rails-3.2.12
Done installing documentation for i18n, multi_json, activesupport, builder, activemodel, rack, rack-cache, rack-test, journey, hike, tilt, sprockets, erubis, actionpack, arel, tzinfo, activerecord, activeresource, mime-types, polyglot, treetop, mail, actionmailer, rack-ssl, thor, rdoc, railties, bundler, rails (58 sec).
29 gems installed
204-252:~ narendra$ rails -v
Rails 2.3.8
204-252:~ narendra$ gem update rails
Updating installed gems**strong text**
Nothing to update
Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
NarendraSoni
  • 2,210
  • 18
  • 26
  • What do you get when you run `gem list -d`? – Scott S Mar 12 '13 at 13:28
  • tilt (1.3.5) Author: Ryan Tomayko Homepage: http://github.com/rtomayko/tilt/ License: MIT Installed at: /Library/Ruby/Gems/1.8 – NarendraSoni Mar 12 '13 at 13:35
  • I am getting some list of gems when i do "gem list -d". – NarendraSoni Mar 12 '13 at 13:36
  • Well, yeah. But is rails 3.2.12 in it? If not, can you update the question and post the list? – Scott S Mar 12 '13 at 13:39
  • actionmailer (3.2.12, 2.3.8) actionpack (3.2.12, 2.3.8) activemodel (3.2.12) activerecord (3.2.12, 2.3.8) activeresource (3.2.12, 2.3.8) activesupport (3.2.12, 2.3.8) arel (3.0.2) builder (3.0.4) erubis (2.7.0) hike (1.2.1) i18n (0.6.4) journey (1.0.4) mail (2.4.4) mime-types (1.21) multi_json (1.6.1) polyglot (0.3.3) rack (1.5.2, 1.4.5, 1.1.6) rack-cache (1.2) rack-ssl (1.3.3) rack-test (0.6.2) rails (2.3.8) rake (0.8.7) sprockets (2.2.2) thor (0.17.0) tilt (1.3.5) treetop (1.4.12) tzinfo (0.3.36) – NarendraSoni Mar 12 '13 at 13:44
  • rails3.2 is missing though i installed it successfully. How i can make Rails2.3.8 to Rails3.2? – NarendraSoni Mar 12 '13 at 13:47

2 Answers2

0

If you're using rbenv you can try running rbenv rehash after updating rails.

If you're in a rails project folder that was built with Rails 2.3.8 then when you run rails -v in that folder it will return that version of rails instead of the latest one. So you could try moving to another folder and see if running rails -v gives you the version you're expecting.

Also, if you installed rails with sudo gem install rails sometimes /usr/bin/rails still points to the old version, so you could update that to point to the new one.

rant
  • 38
  • 4
  • Do i need to make any changes in .bash_login PATH? – NarendraSoni Mar 12 '13 at 13:55
  • No, you shouldn't have to change anything in your .bash_login PATH. – rant Mar 12 '13 at 14:00
  • my current ruby version is 2.0.0p0. and i want to use Rails3.2 along with it. Please suggest me how i can achieve same? – NarendraSoni Mar 12 '13 at 14:04
  • 'gem install rails' says rails3.2 is successfully installed rails3.2.12. But when i do rails -v, i still see 2.3.8. Is there anyway i can completely replace older version with new one? – NarendraSoni Mar 12 '13 at 14:18
  • `gem uninstall rails` it will then ask you which versions you want to uninstall (if you have more than one version installed) – rant Mar 12 '13 at 14:39
  • I removed both the versions of Rails and now when i did 'gem install rails'. Gem was successfully installed. But now 'rails -v' says "command not found". I think something needs to be added in path? or any other issues. Please help me. – NarendraSoni Mar 12 '13 at 15:01
  • Run `gem environment` and try adding the `EXECUTABLE DIRECTORY` to your PATH. You'll also have to `source .bash_login` after the change, or open a new terminal. – rant Mar 12 '13 at 17:15
0

Since rails 3.2.12 is not included in the output of gem list, I suspect you installed the gem with sudo. Installing with sudo and then trying to list the gems without it (or other operations) can give you a different list. Try doing sudo gem list, and if rails 3.2.12 is in there, thats your problem. Try installing it without sudo.

Scott S
  • 2,696
  • 16
  • 20
  • I executed 'gem update'. Now i am able to see Rails(3.2.12). So is there any way of changing current version(2.3.8) to 3.2.12? – NarendraSoni Mar 12 '13 at 14:10
  • I installed rails 3.2.12, and after I did `rails -v` automatically started using that. What do you get when you run `rails -v` now? – Scott S Mar 12 '13 at 14:16
  • i am stil getting rails 2.3.8. – NarendraSoni Mar 12 '13 at 14:20
  • I was facing the same problem with Ruby, but when i updates the path is bash_login file to PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH".. it worked and i am able to find Ruby2.0. – NarendraSoni Mar 12 '13 at 14:25