I am not ruby guy, but I have good experience with apache and php, but I find it really difficult to setup ruby 1.8.7, cause I find a lot of ways to do the same and I am pretty much confused. I want to install open source project management system fedena in ubuntu 12.10 which required ruby 1.8.7 to run.
In ubuntu 12.10 the ruby1.8 package gives you
ruby 1.8.7-p358. The binary it installs is compatible with fedena.
I would also suggest looking into something like rvm in order to maintain different versions of rubies. If you don't need something quite as heavy as rvm you could try rbenv which is a similar idea but allows you to install rubies using the ruby-build plugin or any other method you choose such as source or apt-get. It just makes sure that your projects use the ruby you want it to using a file in the source directory. If you want to go even lighter weight than rbenv there is one more potential alternative you can check out called chruby. It is a similar idea to rbenv but implements it in a slightly different way.
My first suggestion is the only pure apt-get solution but I would suggest using at least chruby to make sure projects use the correct ruby once you have multiple installed.
See @berkes comment about using symlinks for default ruby. If you don't like rbenv, rvm, or chruby it can be a great alternative allowing you to quickly change the system rubies. The command
update-alternatives is a great way to automate this process. Add an alternative using the command:
sudo update-alternatives --set ruby /path/to/ruby
You can also check which alternatives are configured and selected using:
sudo update-alternatives --config ruby