וְהֽוֹצֵאתָ֣ אֶת־הָאִ֣ישׁ הַה֡וּא אוֹ֩ אֶת־הָאִשָּׁ֨ה הַהִ֜וא אֲשֶׁ֣ר עָ֠שׂוּ אֶת־הַדָּבָ֨ר הָרָ֤ע הַזֶּה֙ אֶל־שְׁעָרֶ֔יךָ אֶת־הָאִ֕ישׁ א֖וֹ אֶת־הָאִשָּׁ֑ה וּסְקַלְתָּ֥ם בָּאֲבָנִ֖ים וָמֵֽתוּ׃
فأخرِجْ ذلك الرجلَ أو تلك المرأةَ، مَن فعلَ هذا الأمرَ الشرير، إلى أبوابك، الرجلَ أو المرأةَ، وارجُمْه أو ارجُمْها بالحجارة حتى يموت.
Rashi
והוצאת את האיש ההוא אל שעריך וגו׳ THEN THOU SHALT BRING FORTH THAT MAN [OR THAT WOMAN WHO HAVE DONE THAT EVIL THING] UNTO THY GATES — He who renders אל שעריך in the Targum by לתרע בית דינך, unto the gate of thy court, is in error, for thus we have learned (Sifrei Devarim 148:2; Ketubot 45b): אל שעריך — this means the gate (the city) in which he has worshipped the idol. Or, perhaps this is not so, but it means the gate where he is being judged (the judges sat “at the gate of the city”; cf., e.g., Ruth 4:1 ff.)?! The term שעריך, however, is used below (i.e. here, which is the latter part of this section) and is used above (v. 2), and this suggests an analogy. What is the meaning of שעריך that is mentioned above? Evidently the gate (the city) wherein he served the idol! So, too, does שעריך mentioned below (in our verse) denote the gate in which he served the idol. The correct rendering in the Targum is therefore לקרויך “thou shalt bring him forth unto thy cities” (cf. Rashi on Deuteronomy 16:18).
Ibn Ezra
stone them that is, the man, or the woman, whichever the case may be. Compare “they will burn him and them” [Leviticus 20: 14]. Having mentioned the two possibilities “it be reported to you” [: 3] (i.e., secretly) and “you hear it” [: 3] (i.e., publicly), Scripture must now clarify that though it may have been reported to you, and you may have heard it, one is nevertheless not put to death except by the testimony of two witnesses.
Sforno
את האיש ההוא או את האשה ההיא, no mention is made in this connection of the idolatry being the result of seduction, the victim being foolish and knowing what he or she did, so that there is no need to convict him or her in the location where he or she committed the offence to teach the people who were aware of the sinner’s opinions that the truth is the opposite of what the sinner thought.