External Smart Proxy fails to start Foreman-Proxy since upgrade

Problem: foreman-proxy fails to restart since upgrade from 2.1.2 to 2.5.1 on an external smart proxy

Expected outcome: foreman-proxy starts after new foreman-installer run

Foreman and Proxy versions: 2.5.1

Foreman and Proxy plugin versions: Katello-4.1.0

Other relevant data:
The main goal is to migrate an external smart proxy from an old Foreman server (v.2.1.2, Katello-3.16 ) to a fairly new one (Foreman-2.5.1, Katello-4.1.0. After generating a new foreman-proxy certificate, fixing some dependencies and running foreman-installer on the external smart proxy, it’s been failing with this error. Both foreman-proxy-content install log and foreman-proxy log is showing the same error:

2021-10-20 21:48:43 [NOTICE] [configure] 1500 configuration steps out of 1713 steps complete. 2021-10-20 21:49:04 [ERROR ] [configure] Systemd start for foreman-proxy failed! 2021-10-20 21:49:04 [ERROR ] [configure] journalctl log for foreman-proxy: 2021-10-20 21:49:04 [ERROR ] [configure] -- Logs begin at Wed 2021-10-20 00:29:30 PDT, end at Wed 2021-10-20 21:49:04 PDT. -- 2021-10-20 21:49:04 [ERROR ] [configure] Oct 20 21:49:03 p-tor2-puppet1 systemd[1]: Starting Foreman Proxy... 2021-10-20 21:49:04 [ERROR ] [configure] Oct 20 21:49:04 p-tor2-puppet1 smart-proxy[31535]: Errors detected on startup, see log for details. Exiting: LoadError: libruby.so.2.7: cannot open shared object file: No such file or directory - /opt/theforeman/tfm/root/usr/lib64/gems/ruby/sqlite3-1.3.13/sqlite3/sqlite3_native.so 2021-10-20 21:49:04 [ERROR ] [configure] Oct 20 21:49:04 p-tor2-puppet1 systemd[1]: foreman-proxy.service: main process exited, code=exited, status=1/FAILURE 2021-10-20 21:49:04 [ERROR ] [configure] Oct 20 21:49:04 p-tor2-puppet1 systemd[1]: Failed to start Foreman Proxy. 2021-10-20 21:49:04 [ERROR ] [configure] Oct 20 21:49:04 p-tor2-puppet1 systemd[1]: Unit foreman-proxy.service entered failed state. 2021-10-20 21:49:04 [ERROR ] [configure] Oct 20 21:49:04 p-tor2-puppet1 systemd[1]: foreman-proxy.service failed. 2021-10-20 21:49:04 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Service/Service[foreman-proxy]/ensure: change from 'stopped' to 'running' failed: Systemd start for foreman-proxy failed! 2021-10-20 21:49:04 [ERROR ] [configure] journalctl log for foreman-proxy: 2021-10-20 21:49:04 [ERROR ] [configure] -- Logs begin at Wed 2021-10-20 00:29:30 PDT, end at Wed 2021-10-20 21:49:04 PDT. -- 2021-10-20 21:49:04 [ERROR ] [configure] Oct 20 21:49:03 p-tor2-puppet1 systemd[1]: Starting Foreman Proxy... 2021-10-20 21:49:04 [ERROR ] [configure] Oct 20 21:49:04 p-tor2-puppet1 smart-proxy[31535]: Errors detected on startup, see log for details. Exiting: LoadError: libruby.so.2.7: cannot open shared object file: No such file or directory - /opt/theforeman/tfm/root/usr/lib64/gems/ruby/sqlite3-1.3.13/sqlite3/sqlite3_native.so 2021-10-20 21:49:04 [ERROR ] [configure] Oct 20 21:49:04 p-tor2-puppet1 systemd[1]: foreman-proxy.service: main process exited, code=exited, status=1/FAILURE 2021-10-20 21:49:04 [ERROR ] [configure] Oct 20 21:49:04 p-tor2-puppet1 systemd[1]: Failed to start Foreman Proxy. 2021-10-20 21:49:04 [ERROR ] [configure] Oct 20 21:49:04 p-tor2-puppet1 systemd[1]: Unit foreman-proxy.service entered failed state. 2021-10-20 21:49:04 [ERROR ] [configure] Oct 20 21:49:04 p-tor2-puppet1 systemd[1]: foreman-proxy.service failed. 2021-10-20 21:49:08 [NOTICE] [configure] System configuration has finished.