If sometimes, you got depressed because the rails server command insists in tell you, that a certain port is already in use. But you're sure about to close all ruby process?
I've got a tip for you.
Probably, the process was detached from the console, but it's keep running in background, or there is some initialized process that you don't know its existence, using such port.
I usually try to figure out this kind of problem using lsof, that's a native command for MacOSX and Linux, that tells you which files are attached to a specific port. To know more about it refer to the man page http://unixhelp.ed.ac.uk/CGI/man-cgi?lsof+8
So, you can do something like this:
$ lsof -i :80 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME apache2 511 www-data 3u IPv4 6470920 0t0 TCP *:www (LISTEN) apache2 524 www-data 3u IPv4 6470920 0t0 TCP *:www (LISTEN)
That was my first tip, and I hope get a lot more to share.