Yes, gemsets are ideal for this. I use gemsets for this too.
First you have to create the gemset:
rvm gemset create your-project-name
then use the gemset:
rvm gemset use your-project-name
When you do this, all your gems are unreachable, you can get them back by using rvm gemset use
, which will return to the default gemset (unnamed).
Inside your gemset, you will have to reinstall all needed gems. If you are using bundler, it is as simple as
bundle install
The advantage of using gemsets is that your gems are cleanly seperated. For instance, i ran into trouble with spec
/rspec
scripts when using both rails2 and rails3 together. With gemsets i no longer have any problems. Using an .rvmrc
file per project, even the selection of the correct gemset is automatic, and i can configure my project in rubymine to use the correct gemset too. Awesome :)