關(guān)于gems.ruby-china.org地址更換導(dǎo)致的問題

安裝 json gem的時(shí)候遇到報(bào)錯(cuò), 如下:

? gem install json -v '1.8.6'                                                                                   [ruby-2.5.1][21:12:28]
ERROR:  Could not find a valid gem 'json' (= 1.8.6), here is why:
          Unable to download data from https://gems.ruby-china.org - bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)

這個(gè)問題出現(xiàn)在最近ruby-china更換了 gems.ruby-china的域 https://gems.ruby-china.org 該網(wǎng)址不復(fù)存在.
使用新網(wǎng)址: https://gems.ruby-china.com.
在本地的環(huán)境下安裝gems需要重新執(zhí)行命令:

  1. 修改~/.bundle/config中的源鏈接

  2. 執(zhí)行: gem source -l 然后刪除多余的源鏈接

    gem sources -r https://gems.ruby-china.org
    
  3. 導(dǎo)入新的源鏈接

    gem sources -a https://gems.ruby-china.com
    

然后執(zhí)行 json gem的安裝.

? gem install json -v '1.8.6'                                                                                   [ruby-2.5.1][21:23:34]
Fetching: json-1.8.6.gem (100%)
Building native extensions. This could take a while...
Successfully installed json-1.8.6
WARNING:  Unable to pull data from 'https://gems.ruby-china.org': bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)
1 gem installed
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容