No default toolchain configured after installing rustup - rust

I installed Rust using rustup, but when I try to enter a Rust command like cargo or rustc in my console, the following error appears:
error: no default toolchain configured
Is this a known issue?

If it seems that rustup did not successfully install and configure the stable toolchain, you can do it manually:
rustup install stable
rustup default stable
After testing, it seems like my incomplete installation may have been caused by a network error. You can also try to reinstall to solve the problem.

The problem is due to my connection and my proxy which didn't allow rustc, cargo, and others to be downloaded.
I thought that the all the executables were all-in-one but apparently not.

In my case, I had multirust installed and the following worked for me:
multirust install stable
multirust default stable

I installed rust with root, but my IDE doesn't run as root, so I installed rust without root, all worked well.

Related

Which packages should I install on Cygwin to use simpleScalar - Alpha configuration?

I already installed the following packages version 4.3-1, gcc-core version 11.3.0-1, gcc-g++ version 11.3.0-1. However, when I run the make command after running the make config-alpha command, I get several errors on the screen. I already tried to install other versions of these packages but I still get the same results.errors that I got
Which other additional package should I install?
Assuming that SimpleScalar is the one here:
https://www.es.ele.tue.nl/~yhe/aca/Simplescalar_Download.html
the packaging is ancient (gcc gcc-2.7.2.3) and its manually crafted configure is not considering any recent platforms.
It seems very hard to adjust to a Cygwin build and you can not use the GCC Cygwin compiler for a cross build of a Alpha platform

cargo build-bpf fails on ubuntu

rustc --version = rustc 1.60.0 (7737e0b5c 2022-04-04)
solana --version = solana-cli 1.10.8 (src:623ac656; feat:1122441720)
npm --version = 8.5.1
node --version = v12.22.9
os: ubuntu 22.04 lts
after i run: "npm run build:program-rust" i am getting this error.
/home/[user]/.rustup/toolchains/bpf/bin/cargo: error while loading
shared libraries:libssl.so.1.1: cannot open shared object file: No
such file or directory
same problem with anchor.
i have located libssl0.1.1 there will it help me?
Even though you have the shared object on your system, cargo build-bpf is probably not finding it since it isn't in a standard path. You can try the solutions at How to I tell Rust where to look for a static library? to tell the linker where to find the library.
yes, cargo wasn't in a standard path.
and fixed everything by reinstalling Linux.
it was Ubuntu for testing.
actually moved to Debian reinstalled packages and working properly.

Scrypto simulator installtion failure?

I am trying to install the simulator as per the instruction in here.
I am getting the following failure message:
It looks like it cannot find clang. You should have clang and its development package installed, otherwise this crate cannot build against it, which it apparently needs to do.
Scrypto v0.3 requires you to have llvm installed. Please follow these steps to get it installed:
On Windows: use this installer
On Linux: run sudo apt install llvm
After installation, don't forget to close and reopen your terminal

How to uninstall Rust that was installed via rustup?

I installed Rust on my Ubuntu 16.04 machine through
curl https://sh.rustup.rs -sSf | sh
as can be seen on the Installation Page.
How do I now uninstall Rust?
To uninstall rustc, rustup and cargo from my Ubuntu 16.04 installation, I did:
rustup self uninstall
and it worked.
If you pay attention to the message you get while installing, you will find the command you are looking for:
As for Linux based operating systems, the following command can be used:
rustup self uninstall
this will remove all the Rust Compiler, Tool Chains and Data including rustc and cargo
If you're one window this should wok, but you have to remove C++ build tools manually if you want to remove it as well, though I would never recommend.
You can do this without manually deleting the old rust binaries by uninstalling cargo and then auto-removing its now un-needed dependencies:
sudo apt remove cargo
sudo apt autoremove

Where does rustup install itself to?

I understand that rustup installs the rustc and cargo binaries to ~/.cargo/bin, but where does it install the rustup executable to? As far as I can tell this isn't explained in any documentation and running the installer doesn't tell you either. I'd like to avoid it being installed to anywhere except my home directory, if possible. I'm using macOS if that makes a difference.
By default, rustup is also installed to your home directory:
$ which rustup
/Users/shep/.cargo/bin/rustup
The documentation states:
rustup installs rustc, cargo, rustup and other standard tools to Cargo's bin directory. On Unix it is located at $HOME/.cargo/bin and on Windows at %USERPROFILE%\.cargo\bin. This is the same directory that cargo install will install Rust programs and Cargo plugins.
It goes on to describe how to change the defaults:
rustup allows you to customise your installation by setting the environment variables CARGO_HOME and RUSTUP_HOME before running the rustup-init executable. As mentioned in the Environment Variables section, RUSTUP_HOME sets the root rustup folder, which is used for storing installed toolchains and configuration options. CARGO_HOME contains cache files used by cargo.
In my case rustup (along with it's installed toolchains) is in a folder named .rustup which is on the same level as .cargo
If you used Chocolatey to install Rust, it installs to C:\ProgramData\chocolatey\bin (at least when I used it).
To verify it was installed by Chocolatey, in a PowerShell window run choco list --local-only and see if the returned list contains Rust.
You can uninstall Chocolatey's Rust instance by running choco uninstall rust in an admin PowerShell window.

Resources