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

Time:05-19

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

CodePudding user response:

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.

  • Related