Hi I am beginner to ruby on rails. I have following this on my machine
nilkash@nilkash:~$ ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [i686-linux]
nilkash@nilkash:~$ rails -v
Rails 3.2.3
nilkash@nilkash:~$ rvm -v
rvm 1.19.6 (master) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
nilkash@nilkash:~$ rvm list
rvm rubies
=* ruby-1.9.3-p392 [ i686 ]
# => - current
# =* - current && default
# * - default
nilkash@nilkash:~$ rvm gemset list
gemsets for ruby-1.9.3-p392 (found in /home/nilkash/.rvm/gems/ruby-1.9.3-p392)
(default)
global
latest_rails_stable
=> rails3tutorial2ndEd
I also install rails version 4.0.0. But I don't know how to use different versions of rails. when i create new project it shows rails version 3.x. I want to upgrade it to version 4. How to check list of all installed rails and how to use latest one. Need Help. Thank you.
To know all rails versions released, you check out on all rails versions. You can also do it with your terminal with the command line gem list rails --remote --all | grep "^rails " . I you want to install rails on another version of ruby, you need to switch version of ruby and re-install version of rails.
You can switch between the Ruby versions by typing: rvm use 3.0. 0.
Every Rails project has the version of Rails in the Gemfile that it will use separately from every other app. There's nothing you need to do to manage two different Rails versions.
I also install rails version 4.0.0. But I don't know how to use different versions of rails. when i create new project it shows rails version 3.x. I want to upgrade it to version 4. How to check list of all installed rails and how to use latest one. Need Help. Thank you.
this is because you're still using the current gemset rails3tutorial2ndEd
You need to create a different gemset:
rvm gemset create <new_gemset_name>
then use it:
rvm gemset use <new_gemset_name>
and finally install a new rails version:
gem install rails -v <version_number>
only after doing these things will you be able to make a new project with a different rails version.
If you want to only do a quick command in different rails version you can do:
$ rails _4.0.1_ new MyRailsApp
That way you don't have some gems installed twice as you do when you use gem sets. Bundler should handle the rest so you should only need one gemset.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With