臨時解決 raw.githubusercontent.com 無法訪問的問題

錯誤

### Error

```

Errno::ECONNREFUSED - Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:949:in `rescue in block in connect'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:946:in `block in connect'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:103:in `timeout'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:945:in `connect'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:930:in `do_start'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/net/http.rb:919:in `start'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open-uri.rb:337:in `open_http'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open-uri.rb:756:in `buffer_open'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open-uri.rb:226:in `block in open_loop'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open-uri.rb:224:in `catch'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open-uri.rb:224:in `open_loop'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open-uri.rb:165:in `open_uri'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open-uri.rb:736:in `open'

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open-uri.rb:35:in `open'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/external_sources/podspec_source.rb:19:in `block in fetch'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:86:in `titled_section'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/external_sources/podspec_source.rb:11:in `fetch'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:989:in `fetch_external_source'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:968:in `block (2 levels) in fetch_external_sources'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:967:in `each'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:967:in `block in fetch_external_sources'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:966:in `fetch_external_sources'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:117:in `analyze'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:414:in `analyze'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:238:in `resolve_dependencies'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:160:in `install!'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command/update.rb:63:in `run'

/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command.rb:52:in `run'

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/bin/pod:55:in `<top (required)>'

/usr/local/bin/pod:23:in `load'

/usr/local/bin/pod:23:in `<main>'

```

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:

https://github.com/CocoaPods/CocoaPods/search?q=Failed+to+open+TCP+connection+to+raw.githubusercontent.com%3A443+%28Connection+refused+-+connect%282%29+for+%22raw.githubusercontent.com%22+port+443%29&type=Issues

If none exists, create a ticket, with the template displayed above, on:

https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:

https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...

- CDN:trunk Repo update failed

? https://github.com/CocoaPods/CocoaPods/issues/9542 [closed] [2 comments]

? 08 May 2020

- [!] CDN: trunk Repo update failed - 4 error(s):

? https://github.com/CocoaPods/CocoaPods/issues/9456 [closed] [2 comments]

? 30 Jan 2020

- error for search&install&update

? https://github.com/CocoaPods/CocoaPods/issues/9411 [closed] [3 comments]

? 16 Dec 2019

and 1 more at:

https://github.com/cocoapods/cocoapods/search?q=Failed%20to%20open%20TCP%20connection%20to%20raw.githubusercontent.com%3A443%20%28Connection%20refused%20-%20connect%282%29%20for%20%22raw.githubusercontent.com%22%20port%20443%29&type=Issues&utf8=?

解決

1泡态、查詢真實 IP

通過 https://www.ipaddress.com/ 查詢到raw.githubusercontent.com的真實 IP 地址:

2澈缺、修改 Hosts 文件

$ vim /etc/hosts

末尾添加一下文件

199.232.68.133 raw.githubusercontent.com

mac下 打開host文件 路徑:/etc/hosts? (需要復制到桌面編輯完拉進來替換)

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末腾供,一起剝皮案震驚了整個濱河市拳亿,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌航棱,老刑警劉巖弥臼,帶你破解...
    沈念sama閱讀 211,123評論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異拳喻,居然都是意外死亡梁剔,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,031評論 2 384
  • 文/潘曉璐 我一進店門舞蔽,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人码撰,你說我怎么就攤上這事渗柿。” “怎么了脖岛?”我有些...
    開封第一講書人閱讀 156,723評論 0 345
  • 文/不壞的土叔 我叫張陵朵栖,是天一觀的道長。 經(jīng)常有香客問我柴梆,道長陨溅,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 56,357評論 1 283
  • 正文 為了忘掉前任绍在,我火速辦了婚禮门扇,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘偿渡。我一直安慰自己臼寄,他們只是感情好,可當我...
    茶點故事閱讀 65,412評論 5 384
  • 文/花漫 我一把揭開白布溜宽。 她就那樣靜靜地躺著吉拳,像睡著了一般。 火紅的嫁衣襯著肌膚如雪适揉。 梳的紋絲不亂的頭發(fā)上留攒,一...
    開封第一講書人閱讀 49,760評論 1 289
  • 那天,我揣著相機與錄音嫉嘀,去河邊找鬼炼邀。 笑死,一個胖子當著我的面吹牛吃沪,可吹牛的內(nèi)容都是我干的汤善。 我是一名探鬼主播,決...
    沈念sama閱讀 38,904評論 3 405
  • 文/蒼蘭香墨 我猛地睜開眼票彪,長吁一口氣:“原來是場噩夢啊……” “哼红淡!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起降铸,我...
    開封第一講書人閱讀 37,672評論 0 266
  • 序言:老撾萬榮一對情侶失蹤在旱,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后推掸,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體桶蝎,經(jīng)...
    沈念sama閱讀 44,118評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡驻仅,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,456評論 2 325
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了登渣。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片噪服。...
    茶點故事閱讀 38,599評論 1 340
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖胜茧,靈堂內(nèi)的尸體忽然破棺而出粘优,到底是詐尸還是另有隱情,我是刑警寧澤呻顽,帶...
    沈念sama閱讀 34,264評論 4 328
  • 正文 年R本政府宣布雹顺,位于F島的核電站,受9級特大地震影響廊遍,放射性物質(zhì)發(fā)生泄漏嬉愧。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 39,857評論 3 312
  • 文/蒙蒙 一喉前、第九天 我趴在偏房一處隱蔽的房頂上張望没酣。 院中可真熱鬧,春花似錦卵迂、人聲如沸四康。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,731評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽闪金。三九已至,卻和暖如春论颅,著一層夾襖步出監(jiān)牢的瞬間哎垦,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,956評論 1 264
  • 我被黑心中介騙來泰國打工恃疯, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留漏设,地道東北人。 一個月前我還...
    沈念sama閱讀 46,286評論 2 360
  • 正文 我出身青樓今妄,卻偏偏與公主長得像郑口,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子盾鳞,可洞房花燭夜當晚...
    茶點故事閱讀 43,465評論 2 348

推薦閱讀更多精彩內(nèi)容