Hello, World! Rust - error[E0463]: can't find crate for `core`

Following the tutorial “Hello, World! Rust CDK Quick Start”. Hello, World! Rust CDK Quick Start :: Internet Computer

It gives me the following error:

/rust_hello> dfx deploy
Deploying all canisters.
All canisters have already been created.
Building canisters...
Executing 'cargo build --target wasm32-unknown-unknown --package rust_hello --release'
   Compiling cfg-if v1.0.0
   Compiling base32 v0.4.0
   Compiling opaque-debug v0.3.0
   Compiling regex-syntax v0.6.25
error[E0463]: can't find crate for `core`
  |
  = note: the `wasm32-unknown-unknown` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` due to previous error
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
  |
  = note: the `wasm32-unknown-unknown` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`

error: build failed
The build step failed for canister 'rrkah-fqaaa-aaaaa-aaaaq-cai' with an embedded error: The custom tool failed.

The solution in the following post does not work.-> error[E0463] when trying to run internet-identity

any ideas?

openSUSE TW, Rust and rustup from repos.

Solution:
Delete rust from the repositories, and install it from:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
1 Like