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

rust的版本问题,安装问题,下载问题

rust的版本、安装、下载问题

rust版本问题,

在使用rust的时候,应用rust的包,有时候包的使用和rust版本有关系。

error: failed to run custom build command for `pear_codegen v0.1.2`

Caused by:

process didn't exit successfully: `D:\rust_lang\rocket1\target\debug\build\pear_codegen-88042941b77438f7\build-script-build` (exit code: 101)

--- stderr

Error: Pear requires a nightly or dev version of Rust.

Installed version is: 1.41.1 (2020-02-24). Minimum required: 1.31.0-nightly (2018-10-05).

thread 'main' panicked at 'Aborting compilation due to incompatible compiler.', C:\Users\Administrator\.cargo\registry\src\github.com-1ecc6299db9ec823\pear_codegen-0.1.2\build.rs:31:13

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...

error: build failed

++++++++++++

D:\rust_lang\rocket1>rustup show

Default host: x86_64-pc-windows-msvc

rustup home: C:\Users\Administrator\.rustup

stable-x86_64-pc-windows-msvc (default)

rustc 1.41.1 (f3e1a954d 2020-02-24)

安装rustup,这个也是官网推荐安装的。

下载之后,得到一个文件,

rustup-init.exe

文件大小:8.2Mb

下载的并不是rustc编译器,

我前面文章里面讲入门rust的时候,我安装的是一个msi

是离线安装的。

rustup下载后,是在线安装的。

如果发现你电脑里面有rust

就会提示

error

如果你还想安装,

要么卸载原来的rust

要么rustup --y

带个参数,就可以安装了。

之后,在终端就会出现

info downloading...

building。。。

下载了cargo,rustc,rustdoc等工具。

然后在cmd输入rustup show

可以查看。

D:\rust_lang\rocket1>rustup show

Default host: x86_64-pc-windows-msvc

rustup home: C:\Users\Administrator\.rustup

stable-x86_64-pc-windows-msvc (default)

rustc 1.41.1 (f3e1a954d 2020-02-24)

rust版本:

stable

dev

nighitly

rustup的作用是什么?

DISCUSSION:

rustup installs The Rust Programming Language from the official

release channels, enabling you to easily switch between stable,

betaand nightly compilers and keep them updated. It makes

cross-compiling simpler with binary builds of the standard library

for common platforms.

If you are new to Rust consider running `rustup doc --book` to

learn Rust.

入门网站:

https://www.rust-lang.org/learn/get-started​www.rust-lang.org/learn/get-started​编辑

rustup怎么使用:

参考

rust-lang/rustup​github.com/rust-lang/rustup/blob/master/README.md​编辑

rustup is a toolchain multiplexer. It installs and manages many Rust toolchains and presents them all through a single set of tools installed to ~/.cargo/bin. The rustc and cargo installed to ~/.cargo/bin are proxies that delegate to the real toolchain. rustup then provides mechanisms to easily change the active toolchain by reconfiguring the behavior of the proxies.

So when rustup is first installed running rustc will run the proxy in $HOME/.cargo/bin/rustc, which in turn will run the stable compiler. If you later change the default toolchain to nightly with rustup default nightly, then that same proxy will run the nightly compiler instead.

This is similar to Ruby's rbenv, Python's pyenv, or Node's nvm.

输入命令

rustup default nightly

然后在终端看到在下载东西。

info:syncing channel updates for 'nightly-x86_64-pc-windows-msvc'

info:latest update on 2020-03-11, rust version 1.43.0-nightly

info:downloading component 'cargo'

info:Retrying download for https://static.rust-lang.org/dist/2020-03-11/cargo-nightly-x86_64-pc-windows-msvc.tar.xz

这个网站上有很多东西:

地址:

https://static.rust-lang.org/dist/2020-03-11/

cargo

clippy

rust-docs

rust-std

rustc

rustfmt

info:downloading

info:installing

现在电脑上有2个版本。

C:\Users\Administrator\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin

C:\Users\Administrator\.rustup\toolchains

目录下有

nightly-x86_64-pc-windows-msvc

stable-x86_64-pc-windows-msvc

总结:

要按照rust的包,比如rocket的时候,发现了版本问题。

于是,需要用一个新版本的rust

所以,下载了rustup

我保留了2个版本。

http://www.lryc.cn/news/351066.html

相关文章:

  • SDUT 链表9-------7-9 sdut-C语言实验-约瑟夫问题
  • Anthropic绘制出了大型语言模型的思维图:大型语言模型到底是如何工作
  • 网络工程师练习题
  • 思科模拟器--03.RIP协议路由--24.5.17
  • 当实时互动遇上新硬件:GIAC 全球互联网架构大会「新硬件」专题论坛
  • 赶紧收藏!2024 年最常见 20道 Redis面试题(三)
  • VMware 和 VirtualBox开机自启指定虚拟机详细教程
  • note-网络是怎样连接的2 协议栈和网卡
  • ros学习之路径规划
  • Qt 顺序容器的详细介绍
  • 基于语音识别的智能电子病历(三)之 M*Modal
  • 理解Apache Storm的实际用途和应用场景
  • 【iceberg】数据湖与iceberg调研与实战
  • xrdp多用户多控制界面远程控制
  • git会忽略我们工作改动中的大小写
  • SSL 自定义证书创建过程
  • javaSwing飞机订票系统
  • 赶紧收藏!2024 年最常见 20道 Redis面试题(四)
  • 虚拟列表 vue-virtual-scroller 的使用
  • 前端基础入门三大核心之HTML篇:深入理解重绘与重排 —— 概念、区别与实战演练
  • 【C/C++笔试练习】TCP、IP广播、ARP协议、IP路由器、MAC协议、三次握手、TCP/IP、子网划分年、会抽奖、抄送列表
  • 线程的概念和控制
  • PHS树脂(聚对羟基苯乙烯)为KrF光刻胶专用树脂 本土企业具备百公斤级别量产能力
  • Python 机器学习 基础 之 数据表示与特征工程 【单变量非线性变换 / 自动化特征选择/利用专家知识】的简单说明
  • uniapp-自定义navigationBar
  • 多式联运奇迹:探索 GPT-4o 的尖端功能
  • 前端 CSS 经典:好看的标题动画
  • Vue项目打包优化(element+echarts+vue使用cdn)
  • 【ARM 嵌入式 C 入门及渐进 6.1 -- ARMv8 C 内嵌汇编写系统寄存器的函数实现】
  • ESP32基础应用之使用手机浏览器作为客户端与ESP32作为服务器进行通信