A few hours later I am able to answer my own question. I haven't figured out how to clean the bad rubygems and jekyll installs out of my system yet, but I've figured out how to install RubyGems and Jekyll on Ubuntu 10.04 using a fresh virtual machine. The answer is that it's easier to download and install the RubyGems 1.3.7 package from Ubuntu 10.10 than it is to install RubyGems 1.3.7 from source. Here's my how-to:
Installing Jekyll on Ubuntu 10.04
gem install jekyll will not work with the version of rubygems (1.3.5) that is packaged for Ubuntu 10.04.1, because Jekyll depends on Liquid which requires rubygems 1.3.7. So to install Jekyll on Ubuntu you have to somehow install RubyGems 1.3.7 first. Rather than installing RubyGems from source, the easiest thing to do is install the RubyGems package from the next release of Ubuntu (10.10), because that package is RubyGems version 1.3.7.
First install all the Ruby packages that you'll need:
$ sudo aptitude install ruby-full
Next, download and install the rubygems1.8 package for the Maverick Meerkat (10.10) release of Ubuntu from <packages.ubuntu.com>. Here is the download page. Install the downloaded file by double-clicking on it or with a command like:
The final hurdle is to discover where RubyGems has put the Jekyll binary, because it's not on your path. The command jekyll won't do anything, and you won't find it with any of which jekyll, whereis jekyll or locate jekyll. gem list lists all of the RubyGems you have installed so that you can see that the jekyll gem and its dependencies are installed, and gem contents jekyll lists of all the installed files belonging to the jekyll gem. From the output of that last command you can find that the jekyll binary is at a ridiculous location, this command should run jekyll:
One other thing, some of the problems I had were caused by my umask, which causes files that I create to be readable by only me and not other users. When I was doing sudo gem install ... RubyGems was using this umask and installing files that could only be read by root. If you have a private umask like me (and it seems like the sensible thing to do, generally) you need to remember to temporarily make it more liberal when running installers like RubyGems:
Yeah, I think even my very first attempt when I did sudo ruby setup.rb to install RubyGems 1.3.7 from source and then sudo gem install jekyll to install Jekyll would have worked, if I had done umask 022 first. At some point I may try that on a fresh VM to verify that it works. Installing RubyGems from the future Ubuntu package may still be better though, because it can be easily uninstalled.