Rust学习笔记000 安装

安装命令

  • curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
info: downloading installerWelcome to Rust!This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:/home/ubuntu/.rustupThis can be modified with the RUSTUP_HOME environment variable.The Cargo home directory is located at:/home/ubuntu/.cargoThis can be modified with the CARGO_HOME environment variable.The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:/home/ubuntu/.cargo/binThis path will then be added to your PATH environment variable by
modifying the profile files located at:/home/ubuntu/.profile/home/ubuntu/.bash_profile/home/ubuntu/.bashrcYou can uninstall at any time with rustup self uninstall and
these changes will be reverted.Current installation options:default host triple: x86_64-unknown-linux-gnudefault toolchain: stable (default)profile: defaultmodify PATH variable: yes1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>
  • enter后报错:
    error: could not amend shell profile: ‘/home/ubuntu/.bash_profile’: could not write rcfile file: ‘/home/ubuntu/.bash_profile’: Permission denied (os error 13)

  • 使用命令curl https://sh.rustup.rs -sSf | sh -s – --no-modify-path

$ curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path 
info: downloading installerWelcome to Rust!This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:/home/ubuntu/.rustupThis can be modified with the RUSTUP_HOME environment variable.The Cargo home directory is located at:/home/ubuntu/.cargoThis can be modified with the CARGO_HOME environment variable.The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:/home/ubuntu/.cargo/binThis path needs to be in your PATH environment variable,
but will not be added automatically.You can uninstall at any time with rustup self uninstall and
these changes will be reverted.Current installation options:default host triple: x86_64-unknown-linux-gnudefault toolchain: stable (default)profile: defaultmodify PATH variable: no1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2023-12-28, rust version 1.75.0 (82e1608df 2023-12-21)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'61.4 MiB /  61.4 MiB (100 %)  41.1 MiB/s in  2s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'14.3 MiB /  14.3 MiB (100 %)   5.7 MiB/s in  2s ETA:  0s
info: installing component 'rust-std'23.6 MiB /  23.6 MiB (100 %)  10.4 MiB/s in  2s ETA:  0s
info: installing component 'rustc'61.4 MiB /  61.4 MiB (100 %)  11.5 MiB/s in  5s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'stable-x86_64-unknown-linux-gnu installed - rustc 1.75.0 (82e1608df 2023-12-21)Rust is installed now. Great!To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
environment variable. This has not been done automatically.To configure your current shell, run:
source "$HOME/.cargo/env"
  • 将 Rust 工具链目录添加到 PATH 环境变量中:
source "$HOME/.cargo/env"
  • 测试
$ rustc --version
rustc 1.75.0 (82e1608df 2023-12-21)
$ vim test.rs
$ rustc test.rs 
$ ./test 
test

在这里插入图片描述

错误处理

curl: (1) Protocol “https” not supported or disabled in libcurl

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/588616.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【基础】【Python网络爬虫】【3.chrome 开发者工具】(详细笔记)

Python网络爬虫基础 chrome 开发者工具元素面板(Elements)控制台面板(Console)资源面板(Source)网络面板(Network)工具栏Requests Table详情 chrome 开发者工具 ​ 当我们爬取不同的网站是&…

MATLAB常用笔记记录(持续更新)

3.错误使用 reshape 元素数不能更改。请使用 [] 作为大小输入之一,以自动计算该维度的适当大小。 仔细检查之后发现原因是:两个栅格图层的行列数不一致。解决办法如下: 先改变栅格图层1源文件的投影坐标系,再进行掩膜提取&#x…

Linux环境安装2

1 redis单机版安装 1.1 安装 wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz tar -xzvf tcl8.6.1-src.tar.gz cd /usr/local/tcl8.6.1/unix/ ./configure make && make install使用redis-3.2.8.tar.gz(截止2017年4月的最新稳定版&…

目标检测YOLO系列从入门到精通技术详解100篇-【目标检测】点云配准

目录 几个相关概念 算法原理 什么是点云 点云的处理 ICP 算法 1 问题描述

常用CSS样式

目录 1、文本超出省略号代替 2、自定义滚动条样式 3、文本无法选中 4、字体间距 5、放大动画效果 6、CSS引用数字字体 7、CSS去角 8、CSS :after、:before、::after、::before的使用 9、CSS使用::after去除浮动 10、时间动画属性 transition 11、颜色渐变 12、解决…

javaWeb学生信息管理系统2

一、学生信息管理系统SIMS 一款基于纯Servlet技术开发的学生信息管理系统(SIMS),在设计中没有采用SpringMVC和Spring Boot等框架。系统完全依赖于Servlet来处理HTTP请求和管理学生信息,实现了信息的有效存储、检索和更新&#xf…

React16源码: Component与PureComponent源码实现

概述 Component 就是组件, 这个概念依托于最直观的在react上的一个表现,那就是 React.Component我们写的组件大都是继承于 React.Component 这个baseClass 而写的类这个类代表着我们使用 react 去实现的一个组件那么在react当中不仅仅只有 Component 这一个baseCla…

【web安全】登录界面渗透的思路总结

前言 小菜作者的总结。 如果大家知道其他的安全问题,欢迎大家补充赐教。我们一起完善登录页面的渗透思路。 (如果大家有好的博客讲解对应的漏洞,欢迎分享~) sql注入 登录页面是需要与数据库打交道的。是需要带入数据库查询的…

JVM之jinfo虚拟机配置信息工具

jinfo虚拟机配置信息工具 1、jinfo jinfo(Configuration Info for Java)的作用是实时地查看和调整虚拟机的各项参数。 使用jps -v 可以查看虚拟机启动时显示指定的参数列表,但是如果想知道未被显示指定的参数的系统默认值,除 …

GCP 创建1个windows vm 并连接

有时需要临时使用1台windows 的机器 创建windows vm 既然是临时 直接用gcloud command gcloud compute instances create instance-windows \--zoneeurope-west2-c \--machine-typen2d-standard-4 \--boot-disk-size100GB \--image-projectwindows-cloud \--imagewindows-se…

Rust学习笔记001:HELLOW WORLD + Cargo

Rust介绍 Rust(中文称为“锈”)是一种由Mozilla开发的系统编程语言,它着力于提供安全性、并发性和实用性。Rust的设计目标是消除程序出现的内存安全性问题,如空指针引用、数据竞争等。它通过在编译时进行严格的所有权和借用检查来…

Vue(三):Vue 生命周期与工程化开发

2023 的最后一篇博客,祝大家元旦快乐,新的一年一起共勉! 06. Vue 生命周期 6.1 基本介绍 生命周期就是一个 Vue 示例从 创建 到 销毁 的整个过程,创建、挂载、更新、销毁 有一些请求是必须在某个阶段完成之后或者某个阶段之前执行…

10TB海量JSON数据从OSS迁移至MaxCompute

前提条件 开通MaxCompute。 在DataWorks上完成创建业务流程,本例使用DataWorks简单模式。详情请参见创建业务流程。 将JSON文件重命名为后缀为.txt的文件,并上传至OSS。本文中OSS Bucket地域为华东2(上海)。示例文件如下。 {&qu…

zabbix通过自动发现-配置监控项、触发器(小白教程)

自动发现配置参考链接(不小白,不友好) zabbix-get介绍 1配置 zabbix server:版本7(不影响),IP地址:192.168.0.60zabbix agent:版本agent1(不影响)&#xff…

Megatron-LM源码系列(六):Distributed-Optimizer分布式优化器实现Part1

1. 使用说明 在megatron中指定--use-distributed-optimizer就能开启分布式优化器, 参数定义在megatron/arguments.py中。分布式优化器的思路是将训练中的优化器状态均匀地分布到不同数据并行的rank结点上,相当于开启ZERO-1的训练。 group.add_argument(--use-distr…

SpringIOC之ClassPathXmlApplicationContext

博主介绍:✌全网粉丝5W,全栈开发工程师,从事多年软件开发,在大厂呆过。持有软件中级、六级等证书。可提供微服务项目搭建与毕业项目实战,博主也曾写过优秀论文,查重率极低,在这方面有丰富的经验…

PostgreSQL16.1(Windows版本)

1、卸载原有的PostgreSQL   点击Next即可。  点击OK即可。 卸载完成。 2、安装 (1) 前两部直接Next,第二部可以换成自己想要安装的路径。 (2) 直接点击Next。…

云原生Kubernetes系列 | Job和CronJob使用

云原生Kubernetes系列 | Job和CronJob使用 1. Job和CronJob的作用2. Job3. CronJob1. Job和CronJob的作用 Kubernetes官网-Job和CronJob使用手册 传统运行的pod,比如Deployment管理的Pod,或手工管理的Pod,只要创建好Pod该Pod会一致运行下去。Pod里面运行的是一个daemon守护进…

雪花算法(Snowflake)介绍和Java实现

1、雪花算法介绍 (1) 雪花算法(SnowFlake)是分布式微服务下生成全局唯一ID,并且可以做到去中心化的常用算法,最早是Twitter公司在其内部的分布式环境下生成ID的方式。 雪花算法的名字可以这么理解,世界上没有两片完全相同的雪花,…

前端学习笔记 2:Vue

前端学习笔记 2:Vue Vue 是一个目前最流行的前端响应式框架,关于它的简单介绍可以观看这里。 1.快速入门 Vue 的官网提供一个快速上手指南,有多种方式可以安装和使用 Vue,这里展示一个最简单的方式——直接导入官方提供的在线的…