Fast rails development environment

Everytime I work on a Rails project I open a bunch of terminal tabs: one with the server, another one for the log, another one for the console and so on. I decided to write a couple scripts to do everything automatically. The first one is called tabrun and runs a command in a new terminal tab:

#!/bin/sh
PATHDIR=
pwd

/usr/bin/osascript <<-EOF
activate application "Terminal"
tell application "System Events"
  keystroke "t" using {command down}
end tell
tell application "Terminal"
  repeat with win in windows
  try
    if get frontmost of win is true then
      do script "cd $PATHDIR; $@" in (selected tab of win)
    end if
  end try
  end repeat
end tell
EOF

It is based on a script I found on the net. Then I have a second script called devrails that calls everything:

#!/bin/sh

tabrun thin start
tabrun tail -f log/development.log
tabrun script/console
tabrun
gitx

So now I just cd to the Rails application directory and run devrails. I find all my tabs ready, server running and so on.