I encountered the same issue with hardened Red Hat 8.9.
/usr/share/ruby/open3.rb:213:in spawn’: No such file or directory - facter (Errno::ENOENT)`
when trying to install foreman-installer.
The issue was in mounting /opt/puppetlabs with noexec option which blocks ruby to execute spawn.
Noexec option is added to /opt/puppetlabs /var/tmp and /tmp when I installed Red Hat with DISA STIG or CIS Benchmark for Server Level 2 security profiles.
Finally I removed noexec from /opt/puppetlabs, /var/tmp, /tmp and rebooted the server.
After this Foreman installation and foreman itself works as intended (noexec under /var/tmp and /tmp blocked Remote Execution).