Rust 便携式安装未找到std和core的板条箱
因为我没有root访问权限,所以我在Rust 便携式安装未找到std和core的板条箱,rust,rust-cargo,Rust,Rust Cargo,因为我没有root访问权限,所以我在CentOS Linux 7.8.2003版(核心版)上本地安装了Rust和Cargo,并编辑了.bashrc,以确保环境变量得到更新。 当运行由cargocargo new cargo\u test生成的简单测试,然后尝试cargo build时,我得到了错误 $cargo build--详细 编译cargo_测试v0.1.0(/home/fad19/opt/cargo_测试) 正在运行'rustc--crater name cargo_test--edit
CentOS Linux 7.8.2003版(核心版)
上本地安装了Rust和Cargo,并编辑了.bashrc,以确保环境变量得到更新。
当运行由cargocargo new cargo\u test生成的简单测试,然后尝试cargo build
时,我得到了错误
$cargo build--详细
编译cargo_测试v0.1.0(/home/fad19/opt/cargo_测试)
正在运行'rustc--crater name cargo_test--edition=2018 src/main.rs--error format=json--json=diagnostic rendered ansi--crater type bin--emit=dep info,link-Cembed bitcode=no-C debuginfo=2-C metadata=d253540bc502ec41-C extra filename=-d253540bc502ec41-out dir/home/fad19/opt/cargo\u test/target/debug/deps-C incremental=/home/fad19/opt/cargo\u test/target/debug/deps`
错误[E0463]:找不到“std”的板条箱`
错误:由于上一个错误而中止
有关此错误的详细信息,请尝试“rustc--explain E0463”。
错误:无法编译“货物测试”。
原因:
进程未成功退出:`rustc--crater name cargo_test--edition=2018 src/main.rs--error format=json--json=diagnostic rendered ansi--crater type bin--emit=dep info,link-Cembed bitcode=no-C debuginfo=2-C metadata=d253540bc502ec41-C extra filename=-d253540bc502ec41-out dir/home/fad19/opt/cargo\u test/target/debug/deps-C incremental=/home/fad19/opt/cargo\u test/target/debug/deps`(退出代码:1)
我注意到rustc
命令没有-L/home/fad19/opt/rust/rustc/lib
和-L/home/fad19/opt/rust/rust-std-x86-unknown-linux-gnu/lib/rustlib/x86-unknown-linux-gnu/lib/
。如果我将这些手动添加到Cargo生成的rustc
命令中,则构建工作正常
是cargo
找不到库还是rustc
问题,我该如何解决这个问题
$echo$LD\u库\u路径
/home/fad19/opt/rust/rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/:/home/fad19/opt/rust/rustc/lib
正常安装Rust via不需要根访问权限。你的指南已经过时了,你应该忽略它而代之以阅读。谢谢!你是对的。我想让我使用该指南的原因是,在谷歌搜索“no root rust”时,我得到的解决方案大多与我使用的解决方案相似,还有一些人引用了该解决方案。一种解决方案在sh
之后使用了标志--禁用sudo
,但这也不起作用。正常安装Rust via不需要根访问。你的指南已经过时了,你应该忽略它而代之以阅读。谢谢!你是对的。我想让我使用该指南的原因是,在谷歌搜索“no root rust”时,我得到的解决方案大多与我使用的解决方案相似,还有一些人引用了该解决方案。一种解决方案在sh
之后使用了标志--禁用sudo
,但这也不起作用。