Cargo invocation has failed: Error: exit code: 101.解決辦法
Rust語言
在VS Code中編輯Rust “ Thebook ” 中第二章 “ 猜猜看 ”遊戲程式碼時,嘗試在cargo.toml 中新增rand依賴項,即
cargo.toml
[dependencies]
rand = "0.7.3"
在命令列鍵入$cargo build之後,發現了
Cargo invocation has failed: Error: exit code: 101.
這樣一條彈窗提醒,提示crate啟用失敗。
OUTPUT視窗提示如下:
Running `cargo build --bin=instances --package=instances
--message-format=json`...
Blocking waiting for file lock on package cache
Updating crates.io index warning: spurious network error (2 tries remaining): failed to send request: 操作超時 ; class=Os (2)
warning: spurious network error (1 tries remaining): failed to send request: 操作超時 ; class=Os (2)
error: failed to get `rand` as a dependency of package `instances v1.46.0 (D:\DataFiles\CodesLearning\RUST\Instances)`
Caused by: failed to load source for dependency `rand`
Caused by: Unable to update registry `https://github.com/rust-lang/crates.io-index`
Caused by: failed to fetch `https://github.com/rust-lang/crates.io-index`
Caused by: failed to send request: 操作超時 ; class=Os (2)
最後發現是連線Github網站超時導致。該問題在每次啟動VS Code後,檢查rust-analyzer外掛版本時也會無視已安裝的更新而彈窗提醒。
下面提供連線Github的方法,此方法同樣適用於網頁登入Github連線不上的問題。一般都是通過hosts檔案中新增ip地址解決。
host檔案在C://Windows/system32/dreivrs/etc目錄中。可以先右鍵 -> 屬性更改User的寫入許可權後,再進行編輯儲存。
通過https://github.com.ipaddress.com/www.github.com可以得知當前github網站ip地址已經更改,因此不少文章中提到的hosts修改已經失效。這裡提供向hosts檔案中新增的程式碼如下:
#Github
140.82.113.4 github.com
當然,更推薦先用上述連結查詢之後再進行更改,防止ip地址更新失效。最後,別忘了儲存hosts檔案,並取消User的寫入許可權。
相關文章
- ios clang: error: linker command failed with exit code 1 (use -v to see invocation)解決方法iOSErrorAI
- 簡易的解決方式linker command failed with exit code 1 (use -v to see invocation)AI
- iOS linker command failed with exit code 1 (use v to see invocation)iOSAI
- Navicat tnt版本提示“failed to save password error code”的解決辦法AIError
- Myeclipse 錯誤An internal error has occurred 解決辦法EclipseError
- iOS報錯:linker command failed with exit code 1 (use -v to see invocation)iOSAI
- command 'gcc' failed with exit status 1錯誤問題的解決辦法GCAI
- Command /Applications/Xcode.app/Contents/Developer/usr/bin/copypng failed with exit code 1錯誤解決辦法...APPXCodeDeveloperAI
- RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED解決辦法ErrorDNNAI
- VS 2017 Git failed with a fatal error的解決辦法GitAIError
- Apache無法啟動解決 the requested operation has failedApacheAI
- 解決Xcode報錯:Command /usr/bin/codesign failed with exit code 1XCodeAI
- 【Error】AttributeError: module ‘scipy.misc‘ has no attribute ‘logsumexp‘ 的解決辦法Error
- vscode中Git: host key verification failed的解決辦法VSCodeGitAI
- iOS Error Domain=NSURLErrorDomain Code=-999 “cancelled” 解決辦法iOSErrorAI
- Ping:Transmit Failed, Error Code 65問題解決MITAIError
- opatch error code 73 PrereqSession failed Invalid patch location 解決ErrorSessionAI
- Failed to install *.apk on device null解決辦法AIAPKdevNull
- 使用 Sublime 工具時報Decode error - output not utf-8解決辦法Error
- Proguard returned with error code 1. See console解決辦法”Error
- 【ERROR】OPatch failed with error code 73ErrorAI
- FTP Connection refused error 解決辦法FTPError
- This function has none of DETEMINISTIC,NO SQL錯誤解決辦法FunctionNoneSQL
- ORA-28001: the password has expired解決辦法
- Android Gradle Build Error:Some file crunching failed, see logs for details解決辦法AndroidGradleUIErrorAI
- Command CompileSwift failed with a nonzero exit code in Xcode 10CompileSwiftAIXCode
- Permission denied Command PhaseScriptExecution failed with a nonzero exit codeAI
- “command-not-found has crashed” 解決辦法 (*unsolved)
- Vue 下 ESLint 的 error 解決辦法VueEsLintError
- OPatch failed with error code 73AIError
- Sublime下python 報錯[Decode error - output not utf-8]解決辦法PythonError
- VMware 啟動報錯 "Failed to lock the file"解決辦法AI
- PHP Warning: exec() has been disabled for security 問題解決辦法PHP
- ERROR 1290 (HY000) 解決辦法Error
- 'oracle.sysman.emcp.oms.OmsPlugIn has failed' Error [ID 436605.1]OraclePluginAIError
- Sublime Text 2報 Decode error - output not utf-8 錯誤的解決辦法Error
- Sublime Text 2報“Decode error - output not utf-8”錯誤的解決辦法Error
- IDEA提示failed to load JVM DLL的解決辦法IdeaAIJVM