Configuration of ruby 3.1.2 failed! Error

The Error “!!! Configuration of ruby 3.1.2 failed!”, is an error that is invoked when you are working on macos and are trying to install ruby version 3.1.2 on your system using chruby as you version manager.

Given below is the snippet of the error you might get:

autoreconf: error: 'configure.ac' is required
!!! Configuration of ruby 3.1.2 failed!

I would like to share with you the steps I took to fix the “!!! Configuration of ruby 3.1.2 failed!”

The error, “!!! Configuration of ruby 3.1.2 failed!” is seen because Despite being necessary for both chruby and ruby-install, it appears that ruby-install does not yet explicitly list xz as a dependent.

For a simple fix, you can manually install the xz package with until the new version of ruby-install is fully accessible on Homebrew.

The detailed solution to fix the error “!!! Configuration of ruby 3.1.2 failed!”, is given below:

To fix the error, “!!! Configuration of ruby 3.1.2 failed!” you will have to manually install the xz package with until the new version of ruby-install is fully accessible on Homebrew.

This is because as it appears that ruby-install does not yet explicitly list xz as a dependent.

To fix the error, “!!! Configuration of ruby 3.1.2 failed!”, you will have to follow the steps mentioned below:

Despite being necessary for both chruby and ruby-install, it appears that ruby-install does not yet explicitly list xz as a dependent. For a simple fix to this problem, you can manually install the xz package with until the new version of ruby-install is fully accessible on Homebrew. To do so you can follow the below mentioned code:

brew install xz

Note: Please confirm that xz and subsequently the xzcat code are present on your system. You should then be able to install your desired Ruby version.

This should fix the error “!!! Configuration of ruby 3.1.2 failed!”.

Conclusion

To fix the error, “!!! Configuration of ruby 3.1.2 failed!” you will have to manually install the xz package with until the new version of ruby-install is fully accessible on Homebrew.

This is because it appears that ruby-install does not yet explicitly list xz as a dependent.