报错
Installing racc 1.4.14 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.6.3@rails-encoding-demo/gems/racc-1.4.14/ext/racc
/usr/local/rvm/rubies/ruby-2.6.3/bin/ruby -I /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0 -r ./siteconf20230115-2844-yyzt2q.rb extconf.rb
checking for rb_ary_subseq()... *** 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=/usr/local/rvm/rubies/ruby-2.6.3/bin/$(RUBY_BASE_NAME)
/usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:552:in `try_link0'
from /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:570:in `try_link'
from /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:782:in `try_func'
from /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:1069:in `block in have_func'
from /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
from /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
from /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
from /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
from /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
from /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/mkmf.rb:1068:in `have_func'
from extconf.rb:5:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/rvm/gems/ruby-2.6.3@rails-encoding-demo/extensions/x86_64-linux/2.6.0/racc-1.4.14/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-2.6.3@rails-encoding-demo/gems/racc-1.4.14 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.6.3@rails-encoding-demo/extensions/x86_64-linux/2.6.0/racc-1.4.14/gem_make.out
An error occurred while installing racc (1.4.14), and Bundler cannot continue.
Make sure that `gem install racc -v '1.4.14' --source 'http://mirrors.tuna.tsinghua.edu.cn/rubygems/'` succeeds before bundling.
解决方案
安装 glibc
yum install glibc -y
评论区