Native Gem Installations fail on Chef Client 19 when using Linux distributions such as Ubuntu 20.04, RHEL 9, or Rocky 9 which use GNU ld versions below 2.38
When using Chef Infra Client 19 on Linux distributions such as Ubuntu 20.04, RHEL 9, or Rocky Linux 9, installing native Ruby gems (for example, mysql2) can fail during compilation and linking. This occurs because Chef Infra Client 19 ships a Habitat-based runtime that contains binaries using the .relr.dyn ELF relocation format, which is not supported by system linkers (GNU ld) older than version 2.38. Upgrading the operating system to a distribution that provides GNU ld 2.38 or newer (for example Ubuntu 22.04 or RHEL/Rocky 10) resolves the issue.