When it appears that partition cannot be made equal between the parties according to their respective rights, without prejudice to the rights and interests of some of them, the court may adjudge compensation to be made by one party to another on account of the inequality of partition; but such compensation shall not be required to be made to others by owners unknown, nor by infants, unless in case of an infant it appear that he or she has personal property sufficient for that purpose, and that his or her interest will be promoted thereby.