That’s a weird error.
Is your copy of Tracks really located in /Library/WebServer/Documents… ? On my system, that folder is owned by root/admin, so you might have problems issuing commands there. I would move Tracks to your home folder somewhere.
Did you make sure that you ported your personal settings over from config/database.yml and config/environment.rb to copies made from the trunk version of each of those files? Quite a lot has changed in environment.rb, in particular.
I’m now using Locomotive just to start and stop my server when testing trunk, and I can just go into Terminal to issue commands like rake - no need to use the Terminal built into Locomotive. You just need to cd into your Tracks folder. So, if you have Tracks in ~/Sites/tracks-trunk, then:
cd ~/Sites/tracks-trunk
rake db:migrate