I recently downloaded and unpacked the Rust Language from this site (Linux 64-bit).
I then installed Rust using the given script in the download install.sh
:
root@kali:~# /root/rust-1.9.0-x86_64-unknown-linux-gnu/install.sh
install: uninstalling component 'rustc'
install: creating uninstall script at /usr/local/lib/rustlib/uninstall.sh
install: installing component 'rustc'
install: installing component 'rust-std-x86_64-unknown-linux-gnu'
install: installing component 'rust-docs'
install: installing component 'cargo'
Rust is ready to roll.
I am trying to install a crate with cargo, but I keep running into this error:
root@kali:~# cargo install racer
Updating registry `https://github.com/rust-lang/crates.io-index`
Compiling winapi v0.2.7
Compiling bitflags v0.5.0
error: can't find crate for `std` [E0463]
error: aborting due to previous error
Build failed, waiting for other jobs to finish...
error: can't find crate for `std` [E0463]
error: aborting due to previous error
error: failed to compile `racer v1.2.10`, intermediate artifacts can be found at `/root/target-install`
cargo install cargo-edit
failed with the same result as above, so it's not limited to one particular package.
Even putting a simple program:
fn main() {
println!("Hello, world!");
}
in a file named hello.rs
and running rustc hello.rs
does not compile; it gives the same error: error: can't find crate for 'std' [E0463]
.
The download came with a directory named rust-std-x86_64-unknown-linux-gnu
, which I assume is the std crate. How do I instruct rustc to find this directory when trying to locate the std crate?
cargo install cargo-edit
. Although Racer needs the source code of std, the error message sounds like the compiler can't find the std binaries, so it can't even compiler Racer. – user395760rustc
not knowing where thestd
crate is. – Matthieu M.