Rustup doc giving error

HI, I am new to rust and was reading official rust "book", i installed rust via following cmd: curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh while the official book mentions we can open rust docs locally offline after we have installed rust, by the following command rustup doc but when I run this command, it gives me error: couldn't open browser: IO error: No such file or directory (os error 2). How can I solve this? I even tried with sudo user but that didint worked either.

You might have a BROWSER environment variable set to some command that doesn’t exist? If you have, unsetting it might help. If the BROWSER environment variable is not the problem, it can still be the solution: try setting it to some web-browser, e.g. see if it works if invoked as

env -u BROWSER rustup doc

or

BROWSER="google-chrome" rustup doc

If that solves the issue, consider changing the environment variable permanently (there’s lots of resources out there how to do that, in case you are not familiar).

1 Like

Thanks, the first command worked!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.