rustup 没有安装工具链?

问题描述 投票:0回答:1

恐怕对 rust 来说是个新手,无论如何,只是尝试为 aws cli 安装它..

我安装了 rustup 和 Cargo,但由于某种原因 rustup 拒绝安装工具链。它说它是最新的但未安装:

$ rustup --verbose toolchain install --force stable
verbose: read metadata version: '12'
verbose: installing toolchain 'stable-i686-apple-darwin'
verbose: toolchain directory: '/Users/rich/.rustup/toolchains/stable-i686-apple-darwin'
info: syncing channel updates for 'stable-i686-apple-darwin'
verbose: creating temp file: /Users/rich/.rustup/tmp/c3zs1m83q45lr1sv_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
verbose: downloading with reqwest
verbose: deleted temp file: /Users/rich/.rustup/tmp/c3zs1m83q45lr1sv_file
verbose: no update hash at: '/Users/rich/.rustup/update-hashes/stable-i686-apple-darwin'
verbose: creating temp file: /Users/rich/.rustup/tmp/9yxkef68j5im2ilq_file.toml
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml'
verbose: downloading with reqwest
verbose: checksum passed
verbose: creating temp file: /Users/rich/.rustup/tmp/zlh5ifnl73hbtvyy_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.asc'
verbose: downloading with reqwest
verbose: deleted temp file: /Users/rich/.rustup/tmp/zlh5ifnl73hbtvyy_file
verbose: Good signature from on https://static.rust-lang.org/dist/channel-rust-stable.toml from:
verbose: from builtin Rust release key
verbose:   RSA/85AB96E6-FA1BE5FE - Rust Language (Tag and Release Signing Key) <[email protected]>
verbose:   Fingerprint: 108F 6620 5EAE B0AA A8DD 5E1C 85AB 96E6 FA1B E5FE
verbose: deleted temp file: /Users/rich/.rustup/tmp/9yxkef68j5im2ilq_file.toml
info: latest update on 2024-03-28, rust version 1.77.1 (7cf61ebde 2024-03-27)
verbose: toolchain is already up to date

  stable-i686-apple-darwin unchanged - (toolchain not installed)

info: checking for self-updates
info: downloading self-update
$ rustup show
Default host: i686-apple-darwin
rustup home:  /Users/rich/.rustup

(error: toolchain 'stable-i686-apple-darwin' is not installed, not a directory: '/Users/rich/.rustup/toolchains/stable-i686-apple-darwin')

编辑 - 尝试卸载:

$ rustup uninstall stable
info: no toolchain installed for 'stable-i686-apple-darwin'

$ rustup --verbose toolchain install stable
verbose: read metadata version: '12'
verbose: installing toolchain 'stable-i686-apple-darwin'
verbose: toolchain directory: '/Users/rich/.rustup/toolchains/stable-i686-apple-darwin'
info: syncing channel updates for 'stable-i686-apple-darwin'

...

info: latest update on 2024-03-28, rust version 1.77.1 (7cf61ebde 2024-03-27)
verbose: toolchain is already up to date

  stable-i686-apple-darwin unchanged - (toolchain not installed)

info: checking for self-updates
info: downloading self-update

看起来 1.73.0 是我的 MacOS 10.11 中最后支持的版本,但这也不起作用:

rustup --verbose toolchain install 1.73.0

rust installation
1个回答
0
投票

这是 MacOS 10.11 兼容性问题。我安装了 i686 版本的 rust-init,因此它想使用 i686 工具链,但最新版本似乎不存在该工具链。所以我用以下方法修复了它:

(1.73.0似乎是最新兼容的10.11版本):

rustup --verbose toolchain install 1.73.0-x86_64-apple-darwin
rustup default 1.73.0-x86_64-apple-darwin

感谢用户1937198的提示!

© www.soinside.com 2019 - 2024. All rights reserved.