简体   繁体   中英

rvm gets "undefined method 'empty?' for nil:NilClass" installing Ruby on macos

I'm trying to install Ruby 3.0.x using rvm on a 2018 Mac mini. I couldn't install 3.0.4, 3.0.2, 3.0.0 (then I tried 2.7.5, just to see if the issue was specific to 3.0.x). All 4 of these installs failed with exactly the same error:

    ruby-3.0.4 - #post-configuration - please wait
    ruby-3.0.4 - #compiling - please wait
    Error running '__rvm_make -j6',
    please read /Users/macmini/.rvm/log/1652638839_ruby-3.0.4/make.log
    There has been an error while running make. Halting the installation.

make.log ends with the following lines

    generating encdb.h
    builtin_binary.inc updated
    compiling builtin.c
    encdb.h updated
    x86_64-darwin21-fake.rb updated
    NoMethodError: undefined method `empty?' for nil:NilClass
      <main> at -e:2
    make: *** [.rbconfig.time] Error 1
    +__rvm_make:0> return 2

I get this same failure on Big Sur and on Monterey 12.3.1.

There is an issue on github that has 8 people reporting what sounds like the same error between 8/10/21 and 2/24/22, with no one reporting a solution (except a suggestion of switching to rbenv). Two of these posts have lines at the end of make.log that are extremely similar to what I'm seeing:

    encdb.h updated
    NoMethodError: undefined method `empty?' for nil:NilClass
      -e at -e:2
    make: *** [.rbconfig.time] Error 1
    +__rvm_make:0> return 2

Any assistance would be greatly appreciated! Thanks!!!

Wayne Vucenic

Figured it out. My current & default ruby was set to jruby-9.2.9.0. I set it to ruby-2.7.6 and now 3.0.4 installs without any issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM