Source · the work in full

Rashi on the Prophets and Writings

CC BY · The Judaica Press Complete Tanach, trans. A. J. Rosenberg
Chapter 4

Ruth 4

So-and-So but his name was not written because he did not wish to redeem.
So-and-So Heb. פְּלֹנִי אַלְמֹנִי, rendered [into Aramaic] in the Prophets (I Sam. 21:3) as “hidden, secret.”
פְּלֹּנִי covered and concealed, an expression of (Deut. 17:8): “If [a matter] be concealed (יִפָּלֵא)”; (Gen. 18: 14) “Is anything concealed (הֲיִפָּלֵא) from the Lord?”
אַלְמֹנִי A widow (אַלְמָן), without a name. (Other editions: אַלְמֹנִי. He was widowed of words of Torah, because he should have interpreted: “an Ammonite, but not an Ammonitess; a Moabite, but not a Moabitess.” Yet he said, “lest I mar my heritage.”)

and I will know, for there is no one besides you who is a kinsman, to redeem.

and from Ruth the Moabitess you must buy, and she agrees only if you marry her.

lest I mar my heritage my offspring, like (Ps. 127:3): “Behold the heritage of the Lord is sons,” to give my offspring a stigma, as it is said (Deut. 23:4): “An Ammonite or a Moabite shall not enter the congregation of the Lord,” but he erred by [not interpreting it as] “an Ammonite but not an Ammonitess.”

concerning redemption This is a sale.
and exchange This is an exchange.
one would remove his shoe This is an act of acquisition, as we acquire title with a scarf in lieu of a shoe, and our Rabbis of blessed memory differed on this matter: who gave [the shoe] to whom. Some say that we perform the act of acquisition with the utensil of the acquirer, and Boaz gave [the shoe] to the redeemer, and others say that we perform the act of acquisition with the utensil of the seller, and the redeemer gave [the shoe] to Boaz.
and this was the attestation in Israel the law of testimony.

to preserve the name of the deceased on his heritage Since his wife comes and goes on the estate and brings in and takes out, people say, “This is Mahlon’s wife,” and his name is remembered upon it.

like Rachel and like Leah Even though they were of the tribe of Judah and of the descendants of Leah, they admitted that Rachel was the mainstay of the household, and they mentioned Rachel before Leah.
and be famous lit. and call a name, i.e., may your name become great.

like the house of Perez from which you are descended.

And these are the generations of Perez Since he traced David’s genealogy on Ruth’s name, he returns and traces it on Judah’s name.

You arrive at the cited line; the whole work is yours to read around it. The text is set from the cited public-domain edition.