I installed rust on Ubuntu and checked that version but there's rustc version error.
myunixx@LAPTOP-JSMKVSS3:~$ rustup --version
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `(error reading rustc version)`
I need 'rustc' to use anchor test
. But I can't use it due to this error. I've reinstalled rust but there's no change. How can i fix this problem?
myunixx@LAPTOP-JSMKVSS3:~/myepicproject$ anchor test
Failed to obtain package metadata: `cargo metadata` exited with an error: error: process didn't exit successfully: `rustc -vV` (exit status: 127)
--- stderr
/home/myunixx/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc: error while loading shared libraries: /home/myunixx/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/libstd-7c582493123fc1dd.so: file too short
It looks like there was an issue installing rustc
, even though you have rustup
. A few things you can try:
rustup update
rustup toolchain install stable
rustup self uninstall
and then go back through the instructions at https://www.rust-lang.org/tools/installMore information about rustup at its book: https://rust-lang.github.io/rustup/installation/index.html