This allows me to essentially sandbox each of these applications’ dependencies.
One helpful hint I might offer is to get in the habit of declaring your gemset when you launch a new terminal. I tend to have multiple terminals open at once and it took me awhile to remember that each time I launched a terminal, RVM would fall back to my default gemset. So if I clone a Rails 3.1 project, I need to remember to switch to my rails3.1 gemset prior to runninig bundle install.
Simply put, RVM helps:
- manage versions of Ruby
- manage packages of Gemsets
And, you can set a version as default
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Now that we have multiple gemsets installed, we must first select the one we want to use, and we can also set it as the default gemset by passing it the —default flag:
Installing rails is as easy as installing any other gem: we only need to specify it’s name, but we can always choose a specific version, or to speed up the installation process by skipping the documentation:
1 2 3 4 5
In Summary and Why Am I doing this?
Rails is distributed as a gem, and there are conflicts between Rails 2 and Rails 3, so if you want to run multiple versions of Rails on the same system you need to create a separate gemset for each:
In other words, for application specific gemsets it is convenient to select the version of Ruby and the collection of gems by doing the following:
1 2 3 4 5 6