Got Rails working with a local copy of ruby, gems, and rails, so I can have independent accounts with different versions. I haven't gone back to a clean ubuntu install to verify, and I'm not sure that all these are needed, but I think these are the required packages:
After building ruby, from the top directory in the source:
- cd ext/openssl
- ruby extconf.rb
- make install
Without that last set of steps, I was getting a "no such file to load -- openssl" error when trying to start rails.
After that, install rubygems (download and extract the source, then "ruby setup.rb") and install the rails gem.
References (with thanks to the contributors):