【Rust】第一节:安装

1 说明

一些学习记录

环境:MacOS

2 步骤

1、执行curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

2、看到打印

rust 复制代码
info: downloading installer

Welcome to Rust!

... ...

This path will then be added to your PATH environment variable by
modifying the profile files located at:

  /Users/rogerqian/.profile
  /Users/rogerqian/.bash_profile
  /Users/rogerqian/.zshenv

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: aarch64-apple-darwin
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

3、键入1,回车

4、看到报错

shell 复制代码
could not amend shell profile: '/Users/rogerqian/.bash_profile': could not write rcfile file: '/Users/rogerqian/.bash_profile': Permission denied (os error 13)`

5、修改权限,执行cd /Users/XXX,然后chmod 777 .profile,如果报错中还有其他文件,同理进行修改

6、查看权限修改是否成功ls -l .profile

7、再次执行步骤1、2、3,看到Rust is installed now. Great!即为成功

8、关闭终端,重新进入,rustc --version,验证是否安装成功

9、下载c编译器xcode-select --install(如果你没有的话)

3 参考

Rust 程序设计语言 中文版 安装
解决使用Rustup在Linux或macOS上无法安装Rust(Permission denied (os error 13))

相关推荐
程序员海军7 分钟前
尤雨溪 : Vue 4 已经在规划中了!
前端·javascript·vue.js
2601_9499706919 分钟前
HumanizeDuration 跨端三方库仓颉适配全流程
前端·javascript·flutter
2601_962885721 小时前
如何用 Python 把 K 线重采样成任意周期?
开发语言·python
_孤傲_1 小时前
快速掌握 MySQL 语法
数据库·后端·mysql
Wang's Blog1 小时前
Java 项目实战: 交友项目 - 圈子功能实现:总结
java·开发语言·交友
下一站春风里2 小时前
位运算完整学习笔记:按位与(&)+ 异或(^)
开发语言·c++·算法
风骏时光牛马2 小时前
后端服务接口开发与性能优化
前端
kyriewen2 小时前
我让 4 个 AI 互相 review 代码,最温柔的那个下手最狠
前端·程序员·ai编程
计算机魔术师2 小时前
493家公司白砸AI钱?Apollo这组数据戳破了幻觉
前端
IT_陈寒3 小时前
Java静态变量初始化坑得我头皮发麻
前端·人工智能·后端