In my case on ruby 2.7.6
gem install libv8 -v '3.16.14.19' -- --with-system-v8
And then
gem install therubyracer -- --with-system-v8
worked on Sequoia 15.1.1