Is it possible to install precompiled Ruby versions with RVM

amazon ec2rubyrvm

I'm using EC2 and sometimes launch servers that I want to use only for a short time. Usually I want to install some version or versions of Ruby on them, and for this RVM is very convenient — if it wasn't for the fact that it takes forever to compile Ruby. It's really boring to have to wait almost half an hour just for Ruby to compile when the rest of the server setup is done in minutes. It completely kills the cloud computing experience.

Is there a way to get the convenience of RVM without the inconvenience of compiling each Ruby version for every new server I launch? Can I precompile a Ruby version and keep it somewhere accessible, and then have RVM use that instead of compiling it from source? Can I simply archive some directory under the RVM root dir after I've installed a Ruby version, save it somewhere and then extract it in the right place on the next server I launch? In that case, which files and directories do I need to keep?

I want to use RVM not only to be able to switch between Ruby versions, but also because it allows me to keep separate gemsets for different applications, so not using RVM would be very inconvenient.

All servers have the same OS and architecture, Ubuntu 10.04, 32 bit.

Best Answer

If you roll up and deploy your pre-configured ~/.rvm folder and make sure the remote .bashrc is configured to use it, do you get any problems? From what I can tell, rvm is designed to allow you to do this.

The only snags I imagine could be around making sure you have the right gems and packages in place to allow your code to run. But then, you'd prepare your .rvm on the target platform right? Also, take into account any OS packages required by your ruby environment.