树莓派上rust环境搭建

423 阅读1分钟

1、执行脚本安装

curl --proto '=https' --tlsv1.2 -sSf sh.rustup.rs | sh
选1 enter

2、配置环境变量

vi /etc/profile

...
PATH=$PATH:/root/.cargo/bin
export PATH
...

使配置生效

source /etc/profile

3、验证版本

rustc -V

4、创建hello.rs

fn main() {
     println!("hello, baby!");
}

5、编译执行

rustc hello.rs
./hello

6、安装文件搜索工具

cargo install fd-find