These instructions work best on a fresh system. While I've gotten them to work on a system where I just upgraded from Snow Leopard to Lion and had a previously working development environment (using an older version of Cinderella in my case), it was not without difficulty. It's much easier to start from scratch.
These instructions are for Mac OS X 10.7.x (Lion) only.
If you already use GitHub, this will be the case. You don't have to do anything.
Do the following on your old computer:
cp ~/.ssh/id_rsa ~/Desktop/id_rsa && cp ~/.ssh/id_rsa.pub ~/Desktop/id_rsa.pub
Move the generated files to the desktop of your new computer, then on the new computer run the following:
mkdir -p ~/.ssh && cp ~/Desktop/id_rsa ~/.ssh/id_rsa && cp ~/Desktop/id_rsa.pub ~/.ssh/id_rsa.pub
Follow this tutorial.
If you don't have one already, create a GitHub account. You can use the free account. Once your account is active, complete the following tutorial to make sure everything is hooked up correctly:
The only software prerequisite for building your development environment is the Command Line Tools for Xcode package. This is available for download via your Apple Developer's account. Once logged in to the Apple Developer site, just search for the "Command Line Tools for Xcode" and download the most recent, non-preview release (as of this writing, it was June 2012).
We use Cinderella to automate the building of our development environment.
Cinderella is a fully managed development environment for open source hacking on Mac OSX. It's powered by homebrew and chef. You only need Xcode 4.3 Standalone CLI Tools to get started.
sudo /usr/bin/gem install cinderella --no-rdoc --no-ri
/usr/bin/cinderella
Once Cinderella has completed, restart your Terminal so all the shell changes can take effect.
Cinderella sets up your development environment within your home folder so you don't have to have sudo permissions to install and/or run things. As a result, we also want to keep all our source code in our home folder to take full advantage of this. Create a directory in your home folder called "Projects"; you will checkout all source code into this folder for consistency’s sake.
Now that Cinderella has run, you have rbenv on your system for managing Ruby versions. We use MRI Ruby 1.9.3 primarily on our applications so you'll install and set that as your default Ruby. Doing so is easy:
rbenv install 1.9.3-p125
rbenv global 1.9.3-p125
From now on, the default Ruby on your system will be Ruby 1.9.3. You'll also want to install Bundler so you can install gem dependencies:
gem install bundler
rbenv rehash
Any applications that require an earlier version of Ruby will have directives in their repositories that will prompt rbenv to help you install the necessary version.
Setup that is specific to the application you're working on will be provided in the README.markdown file inside that project's Git repository.