- Rust Programming By Example
- Guillaume Gomez Antoni Boucher
- 334字
- 2021-07-02 19:12:55
Linux/Mac
Unless your distribution provides a package for rustup, you'll need to install rustup by typing the following command in your terminal:
$ curl https://sh.rustup.rs -sSf | sh info: downloading installer Welcome to Rust! [...] Current installation options: default host triple: x86_64-unknown-linux-gnu default toolchain: stable modify PATH variable: yes 1) Proceed with installation (default) 2) Customize installation 3) Cancel installation
This downloaded rustup and asked you whether you want to customize the installation. Unless you have particular needs, you'll be okay with the default.
Note: The $ represents your shell prompt and should not be typed; you must type the text following it. Also, a line of text that doesn't start with $ represents the text output of the program.
To proceed with the installation, enter 1 and press Enter. This will install the rustc compiler, and the cargo package manager, among other things:
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' info: latest update on 2017-07-20, rust version 1.19.0 (0ade33941 2017-07-17) info: downloading component 'rustc' [...] stable installed - rustc 1.19.0 (0ade33941 2017-07-17) Rust is installed now. Great! To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH environment variable. Next time you log in this will be done automatically. To configure your current shell run source $HOME/.cargo/env
As pointed out by the installer, you need to execute the following command in order to add the directory containing these tools in your PATH:
$ source $HOME/.cargo/env # Which is the same as executing the following: $ export PATH="$HOME/.cargo/bin:$PATH"
(This is only needed once because the rustup installer added it to your ~/.profile file.)
Now, test that you have both cargo and rustc, as you'll need them very soon:
$ cargo -V cargo 0.23.0 (61fa02415 2017-11-22) $ rustc -V rustc 1.22.1 (05e2e1c41 2017-11-22)
Cargo is Rust's package manager and build tool: it allows you to compile and run your projects, as well as managing their dependencies.
At the time of writing this book, the stable Rust version was 1.22.0.
- 國內(nèi)圖書情報(bào)知識(shí)圖譜實(shí)證研究
- 非物質(zhì)文化遺產(chǎn)數(shù)字化研究
- 檔案保護(hù)技術(shù)
- 博物館新視覺:博物館管理叢書
- 知中8·了不起的宋版書
- 醫(yī)藥信息處理與分析
- 《葉赫那拉氏族譜》整理與研究
- 知中16·西南聯(lián)大的遺產(chǎn)
- Rust Programming By Example
- 春華集:中華書局員工文選(2019年)
- 基于價(jià)值全面實(shí)現(xiàn)的檔案信息資源配置
- 高校圖書館休閑功能開發(fā)研究
- 四川文理學(xué)院校史(1976—2016)
- 高校圖書館工具書管理與服務(wù)研究
- 圖書館服務(wù)均等化與資源共享(上冊(cè))