Pipeline fails with ruby/bundle errors but the identical code succeeds when running in an independent docker container

I’m learning spec tests and am doing something super simple and can’t seem to be successful.

I have a super-simple .gitlab-ci.yml pipeline that uses a Ruby docker image and then installs a bunch of ruby gems.

The problem is that the pipeline fails when it tries to install/update the ‘unf_ext’ gem and it complains about failing to build the gem native extension.

This is happening with GitLab Community Edition [15.2.0] on RHEL 8.6 and runners running on the same.

I’ve created a container using the exact image(s) as the pipeline uses, run the scripts manually and the “pipeline” succeeds. The only thing it’s really doing is

bundle install --without system_tests --path vendor/bundle --jobs $(nproc)

For the life of me I can’t think of what would be so different in the runner that would be causing this behavior.

I’ve even gone into the pipeline containers and unset all of the bash environment variables that are Gitlab-ish but the bundle still fails.

FYI: I know nothing about Ruby and almost nothing about Gitlab CI/CD.

Any ideas?