It might be worth having the server-manager actually assign the ports, and tell rails what port it is using for which server.