auto-detect rails directory