Guess rails root from git or svn root
Code copied from ag.el