gem 安裝 ruby 環(huán)境報(bào)錯(cuò): __rvm_make -j4

一、安裝 ruby 環(huán)境

  1. 查看 version 列表
> rvm list known
  • 運(yùn)行結(jié)果
# MRI Rubies
[ruby-]1.8.6[-p420]
....
[ruby-]2.5[.7]
[ruby-]2.6[.5]
[ruby-]2.7[.0]
ruby-head
  1. 安裝 ruby 指定版本
> gem install 2.7
  • 運(yùn)行結(jié)果
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.6.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Updating certificates bundle '/usr/local/etc/openssl@1.1/cert.pem'
Requirements installation successful.
Installing Ruby from source to: /Users/jack/.rvm/rubies/ruby-2.6.5, this may take a while depending on your cpu(s)...
ruby-2.6.5 - #downloading ruby-2.6.5, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
Warning: Transient problem: timeout Will retry in 2 seconds. 1 retries left.
  0     0    0     0    0     0      0      0 --:--:--  0:00:30 --:--:--     0
curl: (28) Connection timed out after 30001 milliseconds
There was an error(28).
Checking fallback: https://ftp.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.bz2
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13.4M  100 13.4M    0     0  31994      0  0:07:21  0:07:21 --:--:-- 72231
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.6.5 - #extracting ruby-2.6.5 to /Users/jack/.rvm/src/ruby-2.6.5 - please wait
ruby-2.6.5 - #configuring - please wait
ruby-2.6.5 - #post-configuration - please wait
ruby-2.6.5 - #compiling - please wait
Error running '__rvm_make -j4',
please read /Users/jack/.rvm/log/1592793830_ruby-2.6.5/make.log

There has been an error while running make. Halting the installation.

二憔儿、錯(cuò)誤分析

查看 /Users/jack/.rvm/log/1592793830_ruby-2.6.5/make.log 日志磷醋,基本是因?yàn)閤code環(huán)境和 openssl導(dǎo)致編譯失敗

...
    CFLAGS = -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens   -fno-common -pipe 
    XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN
    CPPFLAGS = -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I. -I.ext/include/x86_64-darwin19 -I./include -I. -I./enc/unicode/12.1.0 
    DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -install_name /Users/jack/.rvm/rubies/ruby-2.6.5/lib/libruby.2.6.dylib -compatibility_version 2.6 -current_version 2.6.5  -fstack-protector-strong -framework Security -framework Foundation  -fstack-protector-strong -framework Security -framework Foundation  
    SOLIBS = -lpthread -ldl -lobjc
    LANG = zh_CN.UTF-8
    LC_ALL = 
    LC_CTYPE = zh_CN.UTF-8
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
...

三屿岂、解決方案一

  1. 重新安裝 xcode-select (安裝失敗可升級(jí)系統(tǒng)或網(wǎng)絡(luò))
xcode-select --install
  1. 重新執(zhí)行 gem install(openssl 是使用 brew 安裝的吴裤,重新指定一下 openssl 路徑)
rvm install 2.6.5 --with-openssl-dir='brew --prefix openssl'
  • 運(yùn)行結(jié)果
mruby-1.3.0 - #removing src/mruby-1.3.0 - please wait
mruby-1.3.0 - #removing rubies/mruby-1.3.0 - please wait
RVM does not have prediction for required space for mruby-1.3.0, assuming 150MB should be enough, let us know if it was not.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/jack/.rvm/rubies/mruby-1.3.0, this may take a while depending on your cpu(s)...
mruby-1.3.0 - #downloading 1.3.0, this may take a while depending on your connection...
mruby-1.3.0 - #extracting 1.3.0 to /Users/jack/.rvm/src/mruby-1.3.0 - please wait
mruby-1.3.0 - #compiling - please wait
mruby-1.3.0 - #installing - please wait
Install of mruby-1.3.0 - #complete
Required ruby-2.7.0 is not installed.
To install do: 'rvm install "ruby-2.7.0"'

四继蜡、解決方案二

使用 reinstall 重新安裝

> rvm reinstall ruby --disable-binary
  • 運(yùn)行結(jié)果
mruby-1.3.0 - #removing src/mruby-1.3.0 - please wait
mruby-1.3.0 - #removing rubies/mruby-1.3.0 - please wait
RVM does not have prediction for required space for mruby-1.3.0, assuming 150MB should be enough, let us know if it was not.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/jack/.rvm/rubies/mruby-1.3.0, this may take a while depending on your cpu(s)...
mruby-1.3.0 - #downloading 1.3.0, this may take a while depending on your connection...
mruby-1.3.0 - #extracting 1.3.0 to /Users/jack/.rvm/src/mruby-1.3.0 - please wait
mruby-1.3.0 - #compiling - please wait
mruby-1.3.0 - #installing - please wait
Install of mruby-1.3.0 - #complete
Required ruby-2.7.0 is not installed.
To install do: 'rvm install "ruby-2.7.0"'

默認(rèn)安裝最新版本

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末诗充,一起剝皮案震驚了整個(gè)濱河市苍蔬,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌蝴蜓,老刑警劉巖碟绑,帶你破解...
    沈念sama閱讀 219,039評(píng)論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異茎匠,居然都是意外死亡格仲,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,426評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門诵冒,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)凯肋,“玉大人,你說(shuō)我怎么就攤上這事汽馋∥甓” “怎么了?”我有些...
    開封第一講書人閱讀 165,417評(píng)論 0 356
  • 文/不壞的土叔 我叫張陵豹芯,是天一觀的道長(zhǎng)悄雅。 經(jīng)常有香客問我,道長(zhǎng)告组,這世上最難降的妖魔是什么煤伟? 我笑而不...
    開封第一講書人閱讀 58,868評(píng)論 1 295
  • 正文 為了忘掉前任,我火速辦了婚禮,結(jié)果婚禮上便锨,老公的妹妹穿的比我還像新娘围辙。我一直安慰自己,他們只是感情好放案,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,892評(píng)論 6 392
  • 文/花漫 我一把揭開白布姚建。 她就那樣靜靜地躺著,像睡著了一般吱殉。 火紅的嫁衣襯著肌膚如雪掸冤。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,692評(píng)論 1 305
  • 那天友雳,我揣著相機(jī)與錄音稿湿,去河邊找鬼。 笑死押赊,一個(gè)胖子當(dāng)著我的面吹牛饺藤,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播流礁,決...
    沈念sama閱讀 40,416評(píng)論 3 419
  • 文/蒼蘭香墨 我猛地睜開眼涕俗,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了神帅?” 一聲冷哼從身側(cè)響起再姑,我...
    開封第一講書人閱讀 39,326評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎找御,沒想到半個(gè)月后元镀,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,782評(píng)論 1 316
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡霎桅,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,957評(píng)論 3 337
  • 正文 我和宋清朗相戀三年凹联,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片哆档。...
    茶點(diǎn)故事閱讀 40,102評(píng)論 1 350
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡蔽挠,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出瓜浸,到底是詐尸還是另有隱情澳淑,我是刑警寧澤,帶...
    沈念sama閱讀 35,790評(píng)論 5 346
  • 正文 年R本政府宣布插佛,位于F島的核電站杠巡,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏雇寇。R本人自食惡果不足惜氢拥,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,442評(píng)論 3 331
  • 文/蒙蒙 一蚌铜、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧嫩海,春花似錦冬殃、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,996評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至奕谭,卻和暖如春涣觉,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背血柳。 一陣腳步聲響...
    開封第一講書人閱讀 33,113評(píng)論 1 272
  • 我被黑心中介騙來(lái)泰國(guó)打工官册, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人难捌。 一個(gè)月前我還...
    沈念sama閱讀 48,332評(píng)論 3 373
  • 正文 我出身青樓攀隔,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親栖榨。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,044評(píng)論 2 355