当前位置: 首页 > news >正文

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

相关文章:

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 la…...

python AI五子棋对战

我写过一篇c++五子棋 c++五子棋代码-CSDN博客 现在又写了python import copy import time from enum import IntEnum import pygame from pygame.locals import *time = time.strftime("%Y-%m-%d %H:%M:%S") version = str(time)# 基础参数设置 square_size = 40 …...

图文证明 费马,罗尔,拉格朗日,柯西

图文证明 罗尔,拉格朗日,柯西 费马引理和罗尔都比较好证,不过多阐述,看图即可: 费马引理: 罗尔定理: 重点来证明拉格朗日和柯西 拉格朗日: 我认为不需要去看l(x)的那一行更好推: 详细的推理过程: 构造 h ( x ) f ( x ) − l ( x ) , 因为 a , b 两点为交点 , f ( a ) l ( …...

CEC2017(Python):粒子群优化算法PSO求解CEC2017(提供Python代码)

一、CEC2017简介 参考文献: [1]Awad, N. H., Ali, M. Z., Liang, J. J., Qu, B. Y., & Suganthan, P. N. (2016). “Problem definitions and evaluation criteria for the CEC2017 special session and competition on single objective real-parameter numer…...

AUTOSAR从入门到精通- 虚拟功能总线(RTE)(一)

目录 前言 几个高频面试题目 RTE S/R接口implicit与Explicit的实现与区别 接口的代码 implicit...

B/S架构云端SaaS服务的医院云HIS系统源码,自主研发,支持电子病历4级

医院云HIS系统源码,自主研发,自主版权,电子病历病历4级 系统概述: 一款满足基层医院各类业务需要的云HIS系统。该系统能帮助基层医院完成日常各类业务,提供病患挂号支持、病患问诊、电子病历、开药发药、会员管理、统…...

看懂基本的电路原理图(入门)

文章目录 前言一、二极管二、电容三、接地一般符号四、晶体振荡器五、各种符号的含义六、查看原理图的顺序总结 前言 电子入门,怎么看原理图,各个图标都代表什么含义,今天好好来汇总一下。 就比如这个电路原理图来说,各个符号都…...

赫夫曼树基本数据结构

自编头文件&#xff1a; #ifndef HUFFMAN_H_INCLUDED #define HUFFMAN_H_INCLUDED#include<limits.h> #include<string.h> typedef struct {unsigned int weight;unsigned int parent,lchild,rchild; }HTNode,*HuffmanTree; typedef char** HuffmanCode;void Sele…...

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

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

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

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

Windows电脑引导损坏?按照这个教程能修复

前言 Windows系统的引导一般情况下是不会坏的&#xff0c;小伙伴们可以不用担心。发布这个帖子是因为要给接下来的文章做点铺垫。 关注小白很久的小伙伴应该都知道&#xff0c;小白的文章都讲得比较细。而且文章与文章之间的关联度其实还是蛮高的。在文章中&#xff0c;你会遇…...

记Android字符串资源支持的参数类型

参数以%开头&#xff0c;后拼接对应的参数类型名称&#xff0c;如下所示&#xff1a; <string name"tips">Hello, %s! You have some new messages.</string> 类型名称如下所示&#xff1a; s字符串格式用于插入字符串值。例如&#xff0c;"Hel…...

Java实现树结构(为前端实现级联菜单或者是下拉菜单接口)

Java实现树结构&#xff08;为前端实现级联菜单或者是下拉菜单接口&#xff09; 我们常常会遇到这样一个问题&#xff0c;就是前端要实现的样式是一个级联菜单或者是下拉树&#xff0c;如图 这样的数据接口是怎么实现的呢&#xff0c;是什么样子的呢&#xff1f; 我们可以看看 …...

MySQL中常用的数据类型

整型 int 有符号范围: -2147483648 ~ 2147483647 int unsigned 无符号范围: 0 ~ 4294967295 int(5) zerofill 仅用于显示&#xff0c;当不满足5位时&#xff0c;按照左边补0&#xff0c;例如: 00002满足时&#xff0c;正常显示 tinyint[(m)] [unsigned] [zerofill] 有符号&a…...

HTML+CSS+JS制作三款雪花酷炫特效

🎀效果展示 🎀代码展示 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...

[C#]使用ONNXRuntime部署一种用于边缘检测的轻量级密集卷积神经网络LDC

源码地址&#xff1a; github.com/xavysp/LDC LDC: Lightweight Dense CNN for Edge Detection算法介绍&#xff1a; 由于深度学习方法的快速发展&#xff0c;近年来&#xff0c;用于执行图像边缘检测的卷积神经网络&#xff08;CNN&#xff09;模型爆炸性地传播。但边缘检测…...

ZigBee案例笔记 - 无线点灯

文章目录 无线点灯实验概述工程关键字工程文件夹介绍Basic RF软件设计框图简单说明工程操作Basic RF启动流程Basic RF发送流程Basic RF接收流程 无线点灯案例无线点灯现象 无线点灯实验概述 ZigBee无线点灯实验&#xff08;即Basic RF工程&#xff09;&#xff0c;由TI公司提供…...

Debezium日常分享系列之:向 Debezium 连接器发送信号

Debezium日常分享系列之&#xff1a;向 Debezium 连接器发送信号 一、概述二、激活源信号通道三、信令数据集合的结构四、创建信令数据集合五、激活kafka信号通道六、数据格式七、激活JMX信号通道八、自定义信令通道九、Debezium 核心模块依赖项十、部署自定义信令通道十一、信…...

《C#程序设计教程》总复习

一、单项选择题 1.short 类型的变量在内存中占据的位数是 ( )。 A. 8 B. 16 C. 32 D. 64 2.对千 int[ 4,5]型的数组 a, 数组元素 a[2,3] 存在数组第 ( )个位置上。 A. 11 B. 12 C. 14 D. 15 3.设 int 类型变量 x,y,z 的值分别是2、3、6 , 那么…...

为什么ChatGPT选择了SSE,而不是WebSocket?

我在探索ChatGPT的使用过程中&#xff0c;发现了一个有趣的现象&#xff1a;ChatGPT在实现流式返回的时候&#xff0c;选择了SSE&#xff08;Server-Sent Events&#xff09;&#xff0c;而非WebSocket。 那么问题来了&#xff1a;为什么ChatGPT选择了SSE&#xff0c;而不是We…...

appium入门基础

介绍 appium支持在不同平台的UI自动化&#xff0c;如web,移动端,桌面端等。还支持使用java&#xff0c;python&#xff0c;js等语言编写自动化代码。主要用于自动化测试脚本&#xff0c;省去重复的手动操作。 Appium官网 安装 首先必须环境有Node.js用于安装Appium。 总体来…...

jsp介绍

JSP 一种编写动态网页的语言&#xff0c;可以嵌入java代码和html代码&#xff0c;其底层本质上为servlet,html部分为输出流&#xff0c;编译为java文件 例如 源jsp文件 <% page contentType"text/html; charsetutf-8" language"java" pageEncoding&…...

Debian安装k8s记录

Debian安装k8s记录 在master和node上安装kube安装master安装node遇到的问题汇总1、kubelet.service报错 failed to pull image "registry.k8s.io/pause:3.6"2、node重启后报错&#xff0c;failed: open /run/flannel/subnet.env: no such file or directory 在master…...

第6课 用window API捕获麦克风数据并加入队列备用

今天是2024年1月1日&#xff0c;新年的第一缕阳光已经普照大地&#xff0c;祝愿看到这篇文章的所有程序员或程序爱好者都能在新的一年里持之以恒&#xff0c;事业有成。 今天也是我加入CSDN的第4100天&#xff0c;但回过头看一看&#xff0c;这么长的时间也没有在CSDN写下几篇…...

图片预览 element-plus 带页码

vue3、element-plus项目中&#xff0c;点击预览图片&#xff0c;并显示页码效果如图 安装 | Element Plus <div class"image__preview"><el-imagestyle"width: 100px; height: 100px":src"imgListArr[0]":zoom-rate"1.2":max…...

【小白专用】winform启动界面+登录窗口 更新2024.1.1

需求场景&#xff1a;先展示启动界面&#xff0c;然后打开登录界面&#xff0c;如果登录成功就跳转到主界面 首先在程序的入口路径加载启动界面&#xff0c;使用ShowDialog显示界面&#xff0c; 然后在启动界面中添加定时器&#xff0c;来实现显示一段时间的效果&#xff0c;等…...

自动化网络故障修复管理

什么是故障管理 故障管理是网络管理的组成部分&#xff0c;涉及检测、隔离和解决问题。如果实施得当&#xff0c;网络故障管理可以使连接、应用程序和服务保持在最佳水平&#xff0c;提供容错能力并最大限度地减少停机时间。专门为此目的设计的平台或工具称为故障管理系统。 …...

Git:常用命令(二)

查看提交历史 1 git log 撤消操作 任何时候&#xff0c;你都有可能需要撤消刚才所做的某些操作。接下来&#xff0c;我们会介绍一些基本的撤消操作相关的命令。请注意&#xff0c;有些操作并不总是可以撤消的&#xff0c;所以请务必谨慎小心&#xff0c;一旦失误&#xff0c…...

Oracle 12c rac 搭建 dg

环境 rac 环境 &#xff08;主&#xff09;byoradbrac 系统版本&#xff1a;Red Hat Enterprise Linux Server release 6.5 软件版本&#xff1a;Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit byoradb1&#xff1a;172.17.38.44 byoradb2&#xff1a;…...

Cisco模拟器-交换机端口的隔离

设计要求将某台交换机的端口划分在不同的VLAN。以实现连接在相同VLAN端口上的计算机可以通信&#xff0c;而连接在不同VLAN端口上的计算机无法通信的目的。 通过设计&#xff0c;一方面可以加强计算机网络的安全&#xff0c;另一方面通过隔绝不同VLAN间的广播包也可以提高网络…...