Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Install Rust And toolchains

1.安装 Homebrew(macOS系统,如果还没有安装):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. 使用 Homebrew 安装 Rust:
brew install rustup
rustup-init
  1. 配置Rust 环境: 按照提示进行配置,通常选择默认选项即可。
Current installation options:


   default host triple: aarch64-apple-darwin
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
  1. 如果想要卸载Rust
rustup self uninstall
  1. 初始化仓库
  • 打开终端,克隆仓库到本地:
git clone https://github.com/yourusername/yourrepository.git
  • 进入仓库目录:
cd yourrepository
  • 初始化 Cargo 项目:
cargo new .
  1. Cargo 环境配置 根据你的提示信息,似乎需要重新启动当前的 shell,或者手动配置环境变量来包含 Cargo 的 bin 目录。以下是详细的步骤:
    1. 在终端中运行:
    . "$HOME/.cargo/env"
    1. 验证 Cargo 是否可用:
    cargo --version
    1. 编辑 ~/.zshrc 文件,添加:
    . "$HOME/.cargo/env"
    1. 重新加载 ~/.zshrc 文件:
    source ~/.zshrc
    1. 最后再验证一次 Cargo:
    cargo --version

完成这些步骤后,你应该可以在 macOS 上顺利使用 Rust 工具链了。如果还有其他问题,请随时告诉我。

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors