When installing the rugged gem for Ruby, you may encounter the following error:
Building native extensions. This could take a while...
ERROR: Error installing rugged:
ERROR: Failed to build gem native extension.
current directory: /Users/camel/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rugged-1.9.0/ext/rugged
/Users/camel/.rbenv/versions/3.1.2/bin/ruby -I /Users/camel/.rbenv/versions/3.1.2/lib/ruby/3.1.0 -r ./siteconf20250914-30496-hhfqv9.rb extconf.rb
checking for gmake... no
checking for make... yes
checking for cmake... no
ERROR: CMake is required to build Rugged.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Solution
1. Install CMake
On macOS, you can install CMake using Homebrew:
brew install cmake
2. Retry Installing the Gem
gem install rugged