” וַיֹּאמֶר יְהוָה אֵלַי אַל תָּצַר אֶת מוֹאָב וְאַל תִּתְגָּר בָּם מִלְחָמָה כִּי לֹא אֶתֵּן לְךָ מֵאַרְצוֹ יְרֻשָּׁה כִּי לִבְנֵי לוֹט נָתַתִּי אֶת עָר יְרֻשָּׁה”
“Then YHVH said to me, ‘Do not harass Moab, nor provoke them to war, for I will not give you any of their land as a possession, because I have given Ar to the sons of Lot as a possession.”
Moses tells the Israelites ‘YHVH said to me, ‘Do not harass Moab’. We can understand that God spoke to Moses but why he added ‘to me’. The answer is that the restriction was temporarily placed on Moses. The big plan was to wait for King David that will come out from Ruth the Moabite and he will take vengeance on them.
‘Do not provoke them to war’ was told to Moses and that included Joshua and the other elders of Israel that were close to Moses and connected to him spiritually. Ruth came out only during the time of the Judges that ruled Israel. She was the daughter of Eglon, the king of Moab. Eglon was killed by the judge Ehud ben Gera to ended the control of Moab over Israel (See Judges 3:12-30).
Ruth stayed in Moab until Elimelech, from the tribe of Yehuda, moved to Moab and Ruth married his son, Boaz.