在ubuntu 16下使用rbenv 安装ruby 2.7.2,总出现如下错误,不能完成安装
BUILD FAILED (Ubuntu 16.04 using ruby-build 20210309)
Inspect or clean up the working tree at /tmp/ruby-build.20210320092618.2977.R5SdiX
Results logged to /tmp/ruby-build.20210320092618.2977.log
Last 10 log lines:
transform_mjit_header: SKIPPED to transform putchar
transform_mjit_header: SKIPPED to transform getchar_unlocked
transform_mjit_header: SKIPPED to transform getc_unlocked
transform_mjit_header: SKIPPED to transform fgetc_unlocked
transform_mjit_header: SKIPPED to transform getchar
ln -sf ../../../.ext/include/x86_64-linux/rb_mjit_min_header-2.7.2.h include/ruby-2.7.0/x86_64-linux/rb_mjit_min_header-2.7.2.h
NoMethodError: undefined method `empty?' for nil:NilClass
-e at -e:2
uncommon.mk:801: recipe for target '.rbconfig.time' failed
make: *** [.rbconfig.time] Error 1
几乎同样的环境却能安装成功,一直不能查出原因,而且安装ruby 3.0.0也报类似的错误。在top命令下发现启动了java,而且CPU占用很高,通过 rbenv versions发现默认ruby版本是jruby 9.2.14,于是将rbenv下的默认版本换为cruby的任意版本就安装成功了。