当前位置: 首页 > 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个版本。

相关文章:

  • SpringCloud微服务调用的超时机制和CompletableFuture异步调用的超时机制原理一样吗?
  • 【Linux】-Elasticsearch安装部署[16]
  • 12、Go Gin使用JWT实现认证机制
  • 晶体振荡器
  • go routing 之 gorilla/mux
  • Flutter 中的 AnimatedPhysicalModel 小部件:全面指南
  • 设计模式 15 Decorator Pattern 装饰器模式
  • 【LeetCode算法】第69题:x的平方根
  • linux mail命令及其历史
  • 免费开源人脸识别系统,支持RESTful API
  • 【Unity】常用的全局类
  • 02-结构型设计模式(共7种)
  • 油猴脚本使用cookie一般是某请求返回的setcookie,一般不是js生成的,直接请求拼接
  • C# 基础之字典——Dictionary(一)
  • QVariant用法(AI ChaptGPT)
  • 《Java编程思想》读书笔记-对象导论
  • 【RocksDB】TransactionDB源码分析
  • 【翻译】babel对TC39装饰器草案的实现
  • android高仿小视频、应用锁、3种存储库、QQ小红点动画、仿支付宝图表等源码...
  • Git 使用集
  • httpie使用详解
  • iOS高仿微信项目、阴影圆角渐变色效果、卡片动画、波浪动画、路由框架等源码...
  • JSONP原理
  • MQ框架的比较
  • orm2 中文文档 3.1 模型属性
  • vue中实现单选
  • 初探 Vue 生命周期和钩子函数
  • 代理模式
  • 飞驰在Mesos的涡轮引擎上
  • 规范化安全开发 KOA 手脚架
  • 普通函数和构造函数的区别
  • 世界编程语言排行榜2008年06月(ActionScript 挺进20强)
  • 想使用 MongoDB ,你应该了解这8个方面!
  • Prometheus VS InfluxDB
  • 曾刷新两项世界纪录,腾讯优图人脸检测算法 DSFD 正式开源 ...
  • #QT(智能家居界面-界面切换)
  • (04)Hive的相关概念——order by 、sort by、distribute by 、cluster by
  • (JS基础)String 类型
  • (Note)C++中的继承方式
  • (PWM呼吸灯)合泰开发板HT66F2390-----点灯大师
  • (笔试题)分解质因式
  • (仿QQ聊天消息列表加载)wp7 listbox 列表项逐一加载的一种实现方式,以及加入渐显动画...
  • (附源码)springboot电竞专题网站 毕业设计 641314
  • (附源码)计算机毕业设计SSM智慧停车系统
  • (过滤器)Filter和(监听器)listener
  • (深入.Net平台的软件系统分层开发).第一章.上机练习.20170424
  • (原創) 是否该学PetShop将Model和BLL分开? (.NET) (N-Tier) (PetShop) (OO)
  • (中等) HDU 4370 0 or 1,建模+Dijkstra。
  • (转载)Linux 多线程条件变量同步
  • .NET Entity FrameWork 总结 ,在项目中用处个人感觉不大。适合初级用用,不涉及到与数据库通信。
  • .Net OpenCVSharp生成灰度图和二值图
  • .NET企业级应用架构设计系列之结尾篇
  • .one4-V-XXXXXXXX勒索病毒数据怎么处理|数据解密恢复
  • .pub是什么文件_Rust 模块和文件 - 「译」
  • [ 隧道技术 ] 反弹shell的集中常见方式(二)bash反弹shell