Mac系统安装Rust

一.需要用到的工具Homebrew

它是Mac系统中的包管理工具,简称brew。

1.检查是否已经安装brew

text 复制代码
# 输出版本号说明已经安装
brew --version

2.安装brew(推荐用国内的镜像源)

text 复制代码
# Shell是zsh的 macOS 10.15 + 默认是 zsh
/bin/zsh -c "$(curl -fsSL [gitee.com/cunkai/Home...](https://link.juejin.cn?target=https%3A%2F%2Fgitee.com%2Fcunkai%2FHomebrewCN%2Fraw%2Fmaster%2FHomebrew.sh "https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh"))"
# Shell是bash的
/bin/bash -c "$(curl -fsSL [gitee.com/cunkai/Home...](https://link.juejin.cn?target=https%3A%2F%2Fgitee.com%2Fcunkai%2FHomebrewCN%2Fraw%2Fmaster%2FHomebrew.sh "https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh"))"

二.用brew安装Rust

text 复制代码
# 一键安装
brew install rustup
# 初始化 按提示配置就行 一般用default
rustup-init

三.配置环境变量

text 复制代码
# 不用打开配置文件直接修改
echo 'export PATH="HOME/.cargo/bin:HOME/.cargo/bin:PATH"' >> ~/.bash_profile
# 使配置生效
source ~/.bash_profile
# ~/.zshrc 同上
# 验证安装

rustc --version
cargo --version
相关推荐
shimly1234563 小时前
RUST Arc
rust
盒马盒马5 小时前
Rust:Vec
开发语言·rust
doiito5 小时前
【Agent Harness实战】认清现实吧,LLM就是个“超级赌场”,而我们需要的是一套“紧箍咒”
架构·rust
盒马盒马5 小时前
Rust:String
java·前端·rust
techdashen6 小时前
用 Rust 真正发出 Ping:FFI 类型、newtype 与 MaybeUninit
开发语言·后端·rust
星栈独行20 小时前
Makepad 应用如何读文件、调接口、保存数据
前端·程序人生·ui·rust·github
guyoung1 天前
BoxAgnts 工具系统(7)——Skill 模板、Agent 代理与 Cron 调度
rust·agent·ai编程
分布式存储与RustFS1 天前
基于Rust的国产开源对象存储RustFS:S3 Table对Iceberg数据湖的适配详解
rust·开源·iceberg·对象存储·rustfs·minio平替·s3 table
Jinkxs1 天前
Rust 性能优化全流程:从 flamegraph 定位瓶颈到 unsafe 与 SIMD 加速,响应快 2 倍
开发语言·性能优化·rust