Hi folks - replying to self in case someone else sees this thread :)
It turns out to be not too painful, though it's pretty hacky, to clone an rvm deployment to another machine sans internet:
1. Build a clean local rvm with all the rubies and gems you want installed.
2. tar/gzip or whatever, the ~/.rvm file, copy and untar it on your remote server in the same directory
3. log in to the server
4. add the rvm loader magic to your .bashrc:
if [[ -s /home/bofh/.rvm/scripts/rvm ]] ; then source /home/bofh/.rvm/scripts/rvm ; fi
5. reload bashrc
6. uninstall all installed rubyies - "rvm uninstall ruby-1.9.1" and so on.
7. delete the existing ruby source in ~/.rvm/src/ruby-1.9.1 etc
8. for each required ruby version
8.1 install the ruby with the exact version name, i.e. "rvm install ruby-1.9.1-p378" - rvm will see the local archive file in ~/.rvm/archives/ and install ruby from there.
8.2 update your rubygems version - this is the only bit of "rvm install" that failed for me, you can either fetch rubygems yourself, or run it from the cache:
cd ~/.rvm/gems/ruby-1.9.1-p378\@global/gems/rubygems-update-1.3.7
rvm 1.9.1
ruby setup.rb
Ruby will now think it has all it's gems installed - but some may have broken binaries. "gem list --local" will report what ruby *thinks* is installed - but it's not to be trusted. So:
8.3 reinstall all the gems
cd ~/.rvm/gems/ruby-1.9.1-p378/cache
for file in *.gem; do gem install $file; done
Check the output for any errors due to missing libraries or the like. But basically, this should work!
Note that for jruby, I think you don't need to do anything, as all the gems are java code (unless you are using something like Nokogiri which has some binary magic, in which case rebuilding the gem as above might work - haven't tried it yet)
I hope this is of use to someone!
Note that you could probably do steps 6 and 7 on your local machine before building the tarball. I'm just writing it up as I did it...
- Korny