簡體   English   中英

rvm 得到“未定義的方法'空?' 對於 nil:NilClass" 在 macOS 上安裝 Ruby

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

我正在嘗試在 2018 Mac mini 上使用 rvm 安裝 Ruby 3.0.x。 我無法安裝 3.0.4、3.0.2、3.0.0(然后我嘗試了 2.7.5,只是想看看問題是否特定於 3.0.x)。 所有 4 次安裝都失敗,並出現完全相同的錯誤:

    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 以以下幾行結尾

    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

我在 Big Sur 和 Monterey 12.3.1 上也遇到了同樣的失敗。

github上有一個問題,有 8 個人報告了 21 年 8 月 10 日和 22 年 2 月 24 日之間聽起來相同的錯誤,但沒有人報告解決方案(除了切換到 rbenv 的建議)。 其中兩個帖子在 make.log 末尾的行與我所看到的非常相似:

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

任何幫助將不勝感激! 謝謝!!!

韋恩·武切尼奇

弄清楚了。 我當前和默認的 ruby​​ 設置為 jruby-9.2.9.0。 我將它設置為 ruby​​-2.7.6,現在安裝 3.0.4 沒有任何問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM