It was the time when I was struck with burden of different ruby version projects. I had installed Ruby 1.9.2 and Rails 3.2.1.
But Thank God, RVM came to rescue.If the project is made on rails 2.3.8 then you can`t run it on rails 3.2.1 simply because it has changed a lot form 2.x to 3.x (versioning problem).
RVM i.e. Ruby version manager, manages different version of ruby. So if I want to run an old project then I can switch to old Ruby version i.e. 1.8.7 and can easily run an old project.
In RVM there comes gemset. Gemset is the list of gems that is required to run the project and it also provides some of the run time.RVM efficiently manages GEMSET for each Ruby version.
For example if I want to run an old ruby project then I would switch the ruby version (my default is ruby 1.9.2) to 1.8.7 by the following command.
"rvm use 1.8.7" # this will switch to ruby 1.8.7
If I want ruby 1.8.7 as my default ruby then I can issue the following command in my console.
"rvm use 1.8.7 --default"
As I told each ruby maintains its own individual gemset. So in order to create a gemset I can issue following command.
"rvm create gemset rails2" # remember that I have switched to ruby 1.8.7 , so this gemset will go in that ruby version only. So rails2 for ruby 1.8.7
Once the gemset is created I can install gems in that gem set, BUT first switch to that particular gemset .
"rvm gemset use rails2" # switching to gemset rails2 for ruby 1.8.7
Now you can install all the gems needed for running a ruby on rails project.
Remember there is a gemset called global gemset. If you dont mention that in which gemset you want to install the gems then all the gems will get installed in the global gem set.
You can create many gemset as you wish in the particular version of ruby.
using ruby 1.8.7 with gemset rails2 I can issue a command like this.
"rvm use 1.8.7@rails2 --default" # I`ve kept this default as I wanna run an old RoR project.
So RVM Ruby Version Manager is really really a great tool for efficiently manage ruby versions. And I encourage you all to use it. In fact it is the best method and good practice too.
But Thank God, RVM came to rescue.If the project is made on rails 2.3.8 then you can`t run it on rails 3.2.1 simply because it has changed a lot form 2.x to 3.x (versioning problem).
RVM i.e. Ruby version manager, manages different version of ruby. So if I want to run an old project then I can switch to old Ruby version i.e. 1.8.7 and can easily run an old project.
In RVM there comes gemset. Gemset is the list of gems that is required to run the project and it also provides some of the run time.RVM efficiently manages GEMSET for each Ruby version.
For example if I want to run an old ruby project then I would switch the ruby version (my default is ruby 1.9.2) to 1.8.7 by the following command.
"rvm use 1.8.7" # this will switch to ruby 1.8.7
If I want ruby 1.8.7 as my default ruby then I can issue the following command in my console.
"rvm use 1.8.7 --default"
As I told each ruby maintains its own individual gemset. So in order to create a gemset I can issue following command.
"rvm create gemset rails2" # remember that I have switched to ruby 1.8.7 , so this gemset will go in that ruby version only. So rails2 for ruby 1.8.7
Once the gemset is created I can install gems in that gem set, BUT first switch to that particular gemset .
"rvm gemset use rails2" # switching to gemset rails2 for ruby 1.8.7
Now you can install all the gems needed for running a ruby on rails project.
Remember there is a gemset called global gemset. If you dont mention that in which gemset you want to install the gems then all the gems will get installed in the global gem set.
You can create many gemset as you wish in the particular version of ruby.
using ruby 1.8.7 with gemset rails2 I can issue a command like this.
"rvm use 1.8.7@rails2 --default" # I`ve kept this default as I wanna run an old RoR project.
So RVM Ruby Version Manager is really really a great tool for efficiently manage ruby versions. And I encourage you all to use it. In fact it is the best method and good practice too.










