Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No default toolchain #148

Closed
reportbase opened this issue Jan 21, 2017 · 12 comments
Closed

No default toolchain #148

reportbase opened this issue Jan 21, 2017 · 12 comments
Labels
question A question (converts to discussion)

Comments

@reportbase
Copy link

New user here. I closely followed the installation instructions at https://rocket.rs/guide/overview/#routing.

I'm getting the following error:
no default toolchain configured

when I run the following command.
sudo ROCKET_ENV=stage cargo run

@impowski
Copy link
Contributor

impowski commented Jan 21, 2017

Are you using Rustup? And to use ROCKET_ENV you need to have a Rocket.toml where your Cargo.toml. This is covering it.

@SergioBenitez
Copy link
Member

@impowski You don't need a Rocket.toml file to use the ROCKET_ENV variable. There are default values for all parameters, as mentioned in the documentation you linked.

@reportbase Did you follow https://rocket.rs/guide/getting-started/? In particular, the command rustup default nightly should resolve your issue.

@impowski
Copy link
Contributor

@SergioBenitez Ah, forgot about default.

@mehcode
Copy link
Contributor

mehcode commented Jan 21, 2017

Just want to chime in that the problem is rustup is a user installation and is affecting only your user's profile (perhaps this operates differently on Mac). I actually have the same issue.

Something like using env_keep is needed here. I'd be nice if rustup took care of this automatically but it'd require sudo permissions and they wanted to avoid that.


@reportbase As a work-around you can do

sudo env "PATH=$PATH" ROCKET_ENV=stage cargo run

@reportbase
Copy link
Author

When I run:
rustup default nightly
rustc -V

the following is returned:
rustc 1.16.0-nightly (a52da95ce 2017-01-20)

When I run:
sudo env "PATH=$PATH" ROCKET_ENV=stage cargo run

the following is returned:
error: no default toolchain configured

@reportbase
Copy link
Author

@SergioBenitez

When I run:
rustup default nightly

the following is returned:
info: using existing install for 'nightly-x86_64-unknown-linux-gnu'
info: default toolchain set to 'nightly-x86_64-unknown-linux-gnu'
nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.16.0-nightly (a52da95ce 2017-01-20)

@impowski
Copy link
Contributor

@reportbase This question is related to rustup, so try to ask there or read their guide on it.

@mehcode
Copy link
Contributor

mehcode commented Jan 22, 2017

@reportbase I'm going to guess something is up from your rustc / rustup configuration. I don't know enough about that to answer in more detail. Sorry, I did have the same problem as you and my work around worked for me.

@mgattozzi
Copy link

If you run cargo with sudo involved and you installed rust via rustup then it executes that command as root. Since root hasn't installed cargo or rust then it will fail. You'll need to install rust via rustup for root as well so you can run sudo commands.

@SergioBenitez SergioBenitez added the question A question (converts to discussion) label Jan 23, 2017
@SergioBenitez
Copy link
Member

@reportbase Have any of these suggestions resolved your issue?

@SergioBenitez
Copy link
Member

Let us know if you weren't able to get this working, @reportbase!

@haheute
Copy link

haheute commented Mar 22, 2017

I have the same issue on arch linux and did this: sudo rustup default nightly-2017-03-16 to solve, which helped.
It installed everything again, so I think I have 2 installations of rust now, but don't know how to launch stage otherwise. The nightly-2017-03-16 is because of this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question (converts to discussion)
Projects
None yet
Development

No branches or pull requests

6 participants