When working with Rails, you can really end up with a lot of things going on at once. When I'm coding, I'll usually have Terminal open with my Mongrel server instance running, a tab with autotest with RedGreen and Growl integration running, and another tab open for me to run other script/generate commands or script/console commands. On top of that, I'll also have my trusty TextMate instance running in a different space and Safari actually running the app in a different space. It's a rather sweet setup, but it's a pain to set it up in the beginning. Naturally, you want all of this to be as painless as possible so that it's just easier to jump in and code when you want to.
I looked into pretty much every way to go about automating this. There's plenty of ways to give it a shot, too- first was Quicksilver and trying to tie together a number of apps in one hotkey grouping, but it didn't give me enough control over running commands in Terminal (specifically with keeping tabs intact).
Next up was Terminal itself, specifically in terms of Terminal's Window Groupings, which ended up really sucking. It lets you save specific numbers of tabs in a certain window, but it doesn't let you automatically run different commands in each tab (you can run a generic command, like "cd ~/railsapp" for each tab which was partway there though). I even went so far to dig into the Terminal .term XML files to manually try to get it to work, but the changes didn't stick.
AppleScript was the next idea, of course. I'm no AppleScript guru, but I know enough to be dangerous. The problem was that Terminal, though much improved in Leopard, still didn't offer a lot of comprehensive ways via AppleScript to modify tabs and run commands.
I even looked at giving Ruby a shot, mostly through libraries like RubyOSA. It basically hooks Ruby into regular apps on your OS X install, so you can use Ruby to control iTunes, for example. Again, though, as it builds upon AppleScript, you run into the problem of getting a finer control of scripting Terminal without definitive AppleScript dictionaries.
After all of this, adjusting my bash profile ended up being the simplest, cleanest, and fastest way to tackle this problem. It's an area I really haven't gotten into very much, but luckily it's really quick to dive into for this simple problem.
Basically you set an alias for longer commands in your profile. If you want to handle it yourself, jump into your profile (create it if the file doesn't exist):
vi ~/.profile
From that point, it's really simple. Set an alias and type in the longer command. For example:
alias ss='script/server'
alias sc='script/console'
alias a='autotest -rails'
...and so on. I have a separate alias to change the directory to a specific Rails project:
alias gt='cd /path/to/railsapp'
alias gtss='gt; ss'
So it's pretty easy for me to use Quicksilver to open Terminal, type "gtss" to start Mongrel, command+T for a new tab, hit "gta" to start autotest, and so on. I can probably refine the process even further by using the "run command in Terminal" bundle within Quicksilver to consolidate the first few steps, too. As a final helpful command, you can start up TextMate and Safari, too:
alias gtm='gt; mate .; open http://localhost:3000'
It's not the perfect solution yet (I'd love to hit one Quicksilver command and spawn 3-4 Terminal tabs, Safari, and TextMate all at once), but I can start up everything in a few seconds compared to half a minute or more than doing it all manually. The result is that I can hop into my development environment much quicker, which means it's a lot easier to get down to business when I need to.