I have similar problem in CentOS 10.
My solution is to visit https://rpmfind.net/linux/rpm2html/search.php?query=libyaml-devel first. Then choose the item you need. For me, I do
curl -O https://rpmfind.net/linux/centos-stream/10-stream/CRB/x86_64/os/Packages/libyaml-devel-0.2.5-16.el10.x86_64.rpm
rpm -Uvh libyaml-devel-0.2.5-16.el10.x86_64.rpm
yum info libyaml-devel # I can see it has installed
bundle install # succeed now