Recommend
If you like my work with RVM, please recommend me *with a comment as to why you recommend me* on
Working With Rails – Thank You!
IRC
I am 'wayneeseguin' in #rvm on irc.freenode.net
If I do not respond right away, leave a message and I'll respond or leave you a memo when I am around.
Sponsors
$ rvm help # Documentation Index

Typical RVM Project Workflow

Thanks to rvmrc support in rvm, you can make a project-specific workflow. The following examples tie into how we typically work with rvm along with the advantages of such approahces.

An example

The most basic workflow is typically project-specific rvmrc's. For each project you work on, you create a new gemset (on the ruby interpreter of choice) and let your rvmrc take care of switching. As an example:

$ rvm use ree@tedxperth

Would use the tedxperth gemset on ruby enterprise edition. To make this easier, we can run:

$ echo 'rvm --create --rvmrc use ree@tedxperth' > .rvmrc

from inside the root of your project. This tells rvm that everytime we change in to the project's directory, it should use ree with the tedxperth gemset, creating the gemset if it doesn't exist. After executing the above command, you can reload RVM in order to make it see the new .rvmrc and allow you check it out and 'trust' it.

$ rvm reload

This basic approach not only ensures we have gems seperate from the rest of the system but also means that out of the box, running 'bundle install' will use the project defined gemset to also store the gems.

We specify a relatively loose requirement on the ruby but still require the developers have a consistent choice in what they use. In this approach, it is important to note we also recommend adding the rvmrc to the git repository and, if possible, deploy via rvm ensuring a consistent choice across all stage.

A more complex example

To look at the other extreme, it is possible to use a combined set of features to automate many levels of setup and to make live easier when working with projects in general.

This approach, as seen in the source for this site and the open-source TEDxPerth web app not only has an rvmrc that specifies gemset and ruby interpreter, but also goes a few steps further to automatically:

Overall, this approach not only ensures you have a consistent environment everywhere you develop and deploy the project, but it also helps with tasks such as continious integration. For further reference, see:

RVM Documentation Index