$ gem install puma
ERROR: Error installing puma: ERROR: Failed to build gem native extension.
current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/puma-5.6.4/ext/puma_http11
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/3.1.0 -r ./siteconf20220404-956-pjyuf6.rb extconf.rb
checking for whether -fstack-protector-strong -D_FORTIFY_SOURCE=2 is accepted as CFLAGS... *** 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=C:/Ruby31-x64/bin/$(RUBY_BASE_NAME)
--with-puma_http11-dir
--without-puma_http11-dir
--with-puma_http11-include
--without-puma_http11-include=${puma_http11-dir}/include
--with-puma_http11-lib
--without-puma_http11-lib=${puma_http11-dir}/lib
C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:498:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:624:in `block in try_compile'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:571:in `with_werror'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:624:in `try_compile'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:688:in `try_cflags'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:694:in `block (2 levels) in append_cflags'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1007:in `block in checking_for'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:362:in `block (2 levels) in postpone'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:332:in `open'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:362:in `block in postpone'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:332:in `open'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:358:in `postpone'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1006:in `checking_for'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:693:in `block in append_cflags'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:692:in `each'
from C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:692:in `append_cflags'
from extconf.rb:6:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/puma-5.6.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/puma-5.6.4 for inspection.
Results logged to C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/puma-5.6.4/gem_make.out
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...