Update Rails version and fixed bugs