So Boaz took Ruth, and she was his wife: and when he went in unto her, the LORD gave her conception, and she bore a son.
Read Chapter 4
Aquinas Study Bible
Ruth had already converted to the faith and worship of the one God and was supported in this by her good life, and so the prohibition about taking foreign wives in Deut 7:2-3 has no place here. (Nicholas of Lyra Com Ruth)