Fail to install puma on Mac OX 13.4.1, receiving error message: Failed to build gem native extension

73 Views Asked by At

I have Ruby 3.2.2, and Sinatra installed. When I tried to install puma, I kept getting the following ERROR message:

Building native extensions. This could take a while...
ERROR:  Error installing puma:
    ERROR: Failed to build gem native extension.

    current directory: /Users/terryzhuang/.rvm/gems/ruby-3.2.2/gems/nio4r-2.5.9/ext/nio4r
/Users/terryzhuang/.rvm/rubies/ruby-3.2.2/bin/ruby extconf.rb
checking for unistd.h... *** 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.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/terryzhuang/.rvm/rubies/ruby-3.2.2/bin/$(RUBY_BASE_NAME)
    --with-unistd-dir
    --without-unistd-dir
    --with-unistd-include
    --without-unistd-include=${unistd-dir}/include
    --with-unistd-lib
    --without-unistd-lib=${unistd-dir}/lib
/Users/terryzhuang/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/mkmf.rb:490:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

I followed the instructions step by step, they did not specify any requirement for a development tool. I'm confused about which development tool I will need to help with the installation of puma.

0

There are 0 best solutions below