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 installer

Welcome 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/.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory is located at:

  /home/ubuntu/.cargo

This 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/bin

This 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/.bashrc

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-gnu
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) 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 installer

Welcome 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/.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory is located at:

  /home/ubuntu/.cargo

This 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/bin

This 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-gnu
     default toolchain: stable (default)
               profile: default
  modify PATH variable: no

1) 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.mfbz.cn/a/282195.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Goodbye2023, Hello 2024!

2023的所有比赛结束了,以后 xcpc 相关的比赛应该都和我没啥关系了,可能只打打蓝桥天梯了,等到明年的时候估计很多算法的东西也都忘记了吧,彻底退休了。打铁人不配叫退役,也不敢公开这篇文章,只敢在没人看的…

【算法】数论---欧拉函数

什么是欧拉函数? 对于正整数n,欧拉函数是小于或等于n的正整数中与n互质的数的数目,记作φ(n) φ(1)1 当m,n互质时,φ(mn)φ(m)∗φ(n) 一、求一个正整数的欧拉函数---(先对它分解质因数,然后套公式&#xf…

2024新年贺词:从“第一次”到“每一次”,锐意进取,未来可期

从“第一次”到“每一次”:锐意进取,未来可期! 2023年,对和数来讲,是很不平凡的一年。在这一年里,我们共同创造并见证了很多个“第一次”。2023年8月,SHANHAI国际版正式在泰国上线。第一次“出…

LLM之RAG实战(九)| 高级RAG 03:多文档RAG体系结构

在RAG(检索和生成)这样的框架内管理和处理多个文档有很大的挑战。关键不仅在于提取相关内容,还在于选择包含用户查询所寻求的信息的适当文档。基于用户查询对齐的多粒度特性,需要动态选择文档,本文将介绍结构化层次检索…

python+opencv实现图片/短视频一键去水印

目录 0 前言1 准备工作2 读取图片或视频3 添加回调获取鼠标绘制水印区域4 调用opencv函数5 绘制蒙版主循环6 去水印主循环总结 0 前言 在制作ppt个人文章或者分享图片过程中,经常会遇到一些带有水印的情况,不少人都希望能够去除这些水印,提高…

分布式存储考点梳理 + 高频面试题

欢迎来到分布式存储模环节,本文我将和你一起梳理面试中分布式系统的数据库的高频考点,做到温故知新。 面试中如何考察分布式存储 广义的分布式存储根据不同的应用领域,划分为以下的类别: 分布式协同系统 分布式文件系统 分布式…

数据结构:单调栈

1.单调栈 单调栈是一种数据结构,其中存放的数据应该是有序的,所以单调栈也有单调递减栈和单调递增栈 单调递增栈:栈顶到栈底的元素大小是从小到大 单调递减栈:栈顶到栈底的元素大小是从大到小 单调栈主要就是用来求一个给定序列中…

上海周边公路骑行路线分享,维乐带你抓住秋天的小尾巴

路线一:松江郊里骑行      在魔都上海,藏着一条自然风景适宜,能眺望黄浦江的美丽骑行路线。导航到华长路杨家角就能到达起点,一路向西,这里路况非常好,只有一条小道,没有汽车的障碍&#xf…

数组(定义,静态初始化,地址值,元素访问,索引,遍历,动态初始化,两种初始化的区别,练习)

文章目录 1.数组概念: 2.数组的定义格式一:格式二:详解:注意点: 3.数组的静态初始化完整格式:格式详解:注意点:简化格式:练习1:练习2:练习3: 4.地…

使用opencv+tesseract识别图片中的表格

描述 在java环境中使用opencv和tesserac识别一个图片表格 环境:opencv和tesseract安装在linux环境下,docker将运行springboot服务 opencv和tesseract的安装和docker加载可参考之前的文章 过程 将图片进行预处理,过滤掉颜色等干扰元素 提…

基于Ubuntu环境Git服务器搭建及使用

基于Ubuntu环境Git服务器搭建及使用 Chapter1 搭建本地git服务器及详细操作步骤1.搭建本地git服务器1.1 环境1.2 服务端配置1.3 创建git专属用户1.4 创建git仓库1.5 配置免密登录基础 2.客户端拉取推送代码2.1客户端创建ssh公钥 2.2 免密配置3.仓库使用(拉取及推送代…

记chrome的hackbar无法post php://input的问题

尽管hackbar支持post请求体,但是当请求体里面没有等于号的时候,无法post出去,这样如果需要使用php://input绕过waf的时候就没法做。 在开发人员工具的网络里面可以看到不使用等于号的情况下没有荷载。 之后在这里看到了解决方法,…

【javaSE】代理并不难

代理: 代理模式最主要的就是在不改变原来代码(就是目标对象)的情况下实现功能的增强 在学习AOP之前先了解代理,代理有两种:一种是动态代理,一类是静态代理。 静态代理 相当于是自己写了一个代理类&#…

pandas将dataframe列中的list转换为多列

在应用机器学习的过程中,很大一部分工作都是在做数据的处理,一个非常常见的场景就是将一个list序列的特征数据拆成多个单独的特征数据。 比如数据集如下所示: data [[John, 25, Male,[99,100,98]],[Emily, 22, Female,[97,99,98]],[Michae…

JUC Lock 锁入门

文章目录 死锁(Deadlock)通过 Visualvm 等工具排查死锁 活锁park & unpark与 wait & notify 的区别park & unpark 实现:点外卖 Lock 对象ReentrantLock 可重入锁可重入lockInterruptibly 方法上锁(可打断)…

门诊病历系统教程,社区诊所电子处方系统软件操作教程

一、软件程序问答 门诊病历系统教程,社区诊所电子处方系统软件操作教程 1、电子处方软件在开处方时候,可以一键导入模板吗? 如下图,软件以 佳易王诊所电子处方软件V17.1为例说明 软件右侧点击 配方模板,只需输入症…

以太坊代币标准解读及相关Dapp的搭建

文章目录 什么是以太坊代币标准1、什么是以太坊2、以太坊代币标准 同质化代币 Dapp 搭建1、MetaMask 的安装2、Ganache 的安装3、实现 ERC-20 代币协议4、前端页面的编写5、部署流程及操作演示 什么是以太坊代币标准 1、什么是以太坊 以太坊(Ethereum)是…

2024年,程序员有哪些危机,有什么应对方式?

在2024年,程序员可能面临的危机主要包括技术更新迅速、职业竞争激烈、工作与生活平衡困难等方面。 为了应对这些危机,程序员可以采取以下策略: 技术更新迅速:随着技术的不断发展,新的编程语言和工具不断涌现&#xff…

52.网游逆向分析与插件开发-游戏反调试功能的实现-检测调试器

码云地址(master分支):https://gitee.com/dye_your_fingers/sro_-ex.git 码云版本号:be9f058bfaaa4b015f2659db842e07ee37e58996 代码下载地址,在 SRO_EX 目录下,文件名为:SRO_Ex检测调试器.z…

迈向通用异常检测和理解:大规模视觉语言模型(GPT-4V)率先推出

PAPERCODEhttps://arxiv.org/pdf/2311.02782.pdfhttps://github.com/caoyunkang/GPT4V-for-Generic-Anomaly-Detection 图1 GPT-4V在多模态多任务异常检测中的综合评估 在这项研究中,我们在多模态异常检测的背景下对GPT-4V进行了全面评估。我们考虑了四种模式&#…