Cleanup rails mode