Latest ruby installation in asdf fails

Problem

You are trying to install the latest ruby version using asdf version manager with

asdf plugin-add ruby
asdf install ruby latest

but that fails with messages like

*** Following extensions are not compiled:
psych:
       Could not be configured. It will not be installed.
       Check /tmp/ruby-build.20250826161307.2841030.HGJPXU/ruby-3.4.5/ext/psych/mkmf.log for more details.
zlib:
       Could not be configured. It will not be installed.
       Check /tmp/ruby-build.20250826161307.2841030.HGJPXU/ruby-3.4.5/ext/zlib/mkmf.log for more details.

BUILD FAILED (Ubuntu 24.04 on x86_64 using ruby-build 20250724)

Solution

Try to install the missing packages with:

sudo apt-get install libyaml-dev