using rails when rails is there and setting the path otherwise.