Receiving the following error when installing, following this link with version 3.1.2 (https://www.xmodulo.com/upgrade-ruby-centos.html) for steps
Building native extensions. This could take a while...
/root/ruby-3.1.2/lib/rubygems/ext/builder.rb:95:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)
current directory: /usr/local/lib/ruby/gems/3.1.0/gems/rbs-2.1.0/ext/rbs_extension
/usr/local/bin/ruby --disable\\=gems -I/usr/local/lib/ruby/3.1.0/x86_64-linux -I /root/ruby-3.1.2/lib -r ./siteconf20220906-108170-eps7go.rb extconf.rb
creating Makefile
current directory: /usr/local/lib/ruby/gems/3.1.0/gems/rbs-2.1.0/ext/rbs_extension
make DESTDIR\\= clean
make[1]: Entering directory `/usr/local/lib/ruby/gems/3.1.0/gems/rbs-2.1.0/ext/rbs_extension'
make[1]: Leaving directory `/usr/local/lib/ruby/gems/3.1.0/gems/rbs-2.1.0/ext/rbs_extension'
current directory: /usr/local/lib/ruby/gems/3.1.0/gems/rbs-2.1.0/ext/rbs_extension
make DESTDIR\\=
make[1]: Entering directory `/usr/local/lib/ruby/gems/3.1.0/gems/rbs-2.1.0/ext/rbs_extension'
compiling constants.c
gcc: error: unrecognized command line option ‘-Wduplicated-cond’
gcc: error: unrecognized command line option ‘-Wmisleading-indentation’
gcc: error: unrecognized command line option ‘-Wimplicit-fallthrough=0’
make[1]: *** [constants.o] Error 1
make[1]: Leaving directory `/usr/local/lib/ruby/gems/3.1.0/gems/rbs-2.1.0/ext/rbs_extension'
make failed, exit code 2
Gem files will remain installed in /usr/local/lib/ruby/gems/3.1.0/gems/rbs-2.1.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/3.1.0/extensions/x86_64-linux/3.1.0-static/rbs-2.1.0/gem_make.out
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:44:in `block in make'
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:36:in `each'
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:36:in `make'
from /root/ruby-3.1.2/lib/rubygems/ext/ext_conf_builder.rb:63:in `block in build'
from /root/ruby-3.1.2/lib/tempfile.rb:317:in `open'
from /root/ruby-3.1.2/lib/rubygems/ext/ext_conf_builder.rb:26:in `build'
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:161:in `build_extension'
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:195:in `block in build_extensions'
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:192:in `each'
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:192:in `build_extensions'
from /root/ruby-3.1.2/lib/rubygems/installer.rb:853:in `build_extensions'
from /root/ruby-3.1.2/lib/rubygems/installer.rb:328:in `install'
from ./tool/rbinstall.rb:899:in `block in install'
from ./tool/rbinstall.rb:713:in `no_write'
from ./tool/rbinstall.rb:899:in `install'
from ./tool/rbinstall.rb:1068:in `block (2 levels) in <main>'
from ./tool/rbinstall.rb:1043:in `foreach'
from ./tool/rbinstall.rb:1043:in `block in <main>'
from ./tool/rbinstall.rb:1127:in `block in <main>'
from ./tool/rbinstall.rb:1124:in `each'
from ./tool/rbinstall.rb:1124:in `<main>'
/root/ruby-3.1.2/lib/rubygems/ext/builder.rb:95:in `run': make failed, exit code 2 (Gem::InstallError)
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:44:in `block in make'
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:36:in `each'
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:36:in `make'
from /root/ruby-3.1.2/lib/rubygems/ext/ext_conf_builder.rb:63:in `block in build'
from /root/ruby-3.1.2/lib/tempfile.rb:317:in `open'
from /root/ruby-3.1.2/lib/rubygems/ext/ext_conf_builder.rb:26:in `build'
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:161:in `build_extension'
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:195:in `block in build_extensions'
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:192:in `each'
from /root/ruby-3.1.2/lib/rubygems/ext/builder.rb:192:in `build_extensions'
from /root/ruby-3.1.2/lib/rubygems/installer.rb:853:in `build_extensions'
from /root/ruby-3.1.2/lib/rubygems/installer.rb:328:in `install'
from ./tool/rbinstall.rb:899:in `block in install'
from ./tool/rbinstall.rb:713:in `no_write'
from ./tool/rbinstall.rb:899:in `install'
from ./tool/rbinstall.rb:1068:in `block (2 levels) in <main>'
from ./tool/rbinstall.rb:1043:in `foreach'
from ./tool/rbinstall.rb:1043:in `block in <main>'
from ./tool/rbinstall.rb:1127:in `block in <main>'
from ./tool/rbinstall.rb:1124:in `each'
from ./tool/rbinstall.rb:1124:in `<main>'
make: *** [do-install-all] Error 1