Gem Rails Version Showing Wrong?

Hello, and first of all, Im starting with ruby and Ive installed into my server, sorry for my newbie question here guys.

After install rails when I type rails -v it shows Rails 2.3.18 but after I type gem dependency rails it shows Gem rails-4.2.0 and other dependencies.

Please, what are the real version?

Thanks very much.

Like that:

#rails -v

Rails 2.3.18

gem dependency rails

Gem rails-4.2.0

…show the dependencies

It seems you have installed rails version 2.3, but when you run gem dependency rails, it shows the data for the latest release.
Run gem install rails -v 4.2.0 to get the 4.2.0 version
Correct me if I am wrong.

I presume by that you mean that it shows the dependencies for several
versions of rails. In which case it means you have several versions
of rails installed. Your application will use whichever version you
specify in Gemfile.

rails -v shows you which version is in use.
If you need to manage multiple versions I advise using rvm. Others
like rbenv I believe.

gem list will show you all the versions of gems that are installed.

If you have not already done so then, as you are a beginner with
rails, I suggest working right through a good tutorial such as
railstutorial.org (which is free to use online). That will show you
the basics of rails.

Colin

Thanks for the answer guys, its truth, I have two versions installed, the server has latest version of Cpanel/WHM and it has a script developed by Cpanel to install ruby 1.8.3 ( /scripts/installruby ) that way ruby will appear at the Cpanel from each user and they can manage the apps, if I install any other version I need to manage the apps via command line but I need latest version then I’ve installed ruby from scratch downloading the latest version from https://www.ruby-lang.org/en/downloads/
When I type ruby -v it shows 2.2.0 but at rails it shows 2.3.8. Thanks Very Much to shows me the free online book! It will gonna be a very good reference to me!

I’ll uninstall the rails and all dependencies and try to install the latest version and then I’ll install rvm.

Best Regards!

Tiago Rossi

Hello again guys, very strange, but today I’ve checked the rails version and it showed Rails 4.2.0 so I think its fine for now.
Thanks and Best Regards

Tiago Rossi

Thanks for the answer guys, its truth, I have two versions installed, the
server has latest version of Cpanel/WHM and it has a script developed by
Cpanel to install ruby 1.8.3 ( /scripts/installruby ) that way ruby will
appear at the Cpanel from each user and they can manage the apps, if I
install any other version I need to manage the apps via command line but I
need latest version then I've installed ruby from scratch downloading the
latest version from https://www.ruby-lang.org/en/downloads/
When I type ruby -v it shows 2.2.0 but at rails it shows 2.3.8. Thanks Very
Much to shows me the free online book! It will gonna be a very good
reference to me!
I'll uninstall the rails and all dependencies and try to install the latest
version and then I'll install rvm.

Install rvm first, then install rails within rvm. No particular need
to remove anything first unless you need the space.

Colin