How can you install new versions of Ruby, Rails, and Git without running into the old versions? I've been having this problem for the past several years where I like to stay up-to-date and install the latest versions of software like Ruby, Rails, and Git. However, I somehow always seem to have difficulty using the latest versions.

For example, I go to the terminal and type

git --version


Which tells me that I'm running git 1.7.3.4

So I go to the git website and pick up the handy installer file (git-1.7.6-x86_64-snow-leopard.dmg). Then I mount the disk image and run the .pkg file... successfully installed.

However, when I go back and type git --version again, it still says I'm running git 1.7.3.4 and not the newly installed 1.7.6.

Generally whenever I've had these problems it has turned out that I had successfully completed the installations of the new software, I just don't necessarily know where it's installed. What is the best way to keep clean installations of these and not have a bunch of different versions lying around in different places on the file system?
This would be the case where you may want to use a packange manager like MacPorts or Fink. They generally install in a seperate directory like /opt/local/bin so as not to collide with the already installed software. (Note that these download the source codes and dependancies and compile them instead of fetching a compiled binary, so it can take some time for larger packages.)

Another think to do is open up the .pkg file in Installer and Get Info (⌘I) to list all the files, and often where they go. You can also show the log (⌘L) to see where things have been written and what has been done.