Code Monkey home page Code Monkey logo

rustschool's Introduction

rustschool

Installation

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

Use rustup, the Rust tool used to install, upgrade, and manage Rust.

 chovey@s1088757/Users/chovey> curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

  /Users/chovey/.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory is located at:

  /Users/chovey/.cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:

  /Users/chovey/.cargo/bin

This path will then be added to your PATH environment variable by
modifying the profile files located at:

  /Users/chovey/.profile
  /Users/chovey/.bash_profile
  /Users/chovey/.zshenv
  /Users/chovey/.config/fish/conf.d/rustup.fish

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: aarch64-apple-darwin
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>1

info: profile set to 'default'
info: default host triple is aarch64-apple-darwin
warning: Updating existing toolchain, profile choice will be ignored
info: syncing channel updates for 'stable-aarch64-apple-darwin'
info: latest update on 2024-05-02, rust version 1.78.0 (9b00956e5 2024-04-29)
info: downloading component 'rust-src'
info: downloading component 'cargo'
  6.3 MiB /   6.3 MiB (100 %)   2.9 MiB/s in  1s ETA:  0s
info: downloading component 'clippy'
info: downloading component 'rust-docs'
 15.1 MiB /  15.1 MiB (100 %)   7.3 MiB/s in  2s ETA:  0s
info: downloading component 'rust-std'
 22.6 MiB /  22.6 MiB (100 %)   7.3 MiB/s in  3s ETA:  0s
info: downloading component 'rustc'
 50.7 MiB /  50.7 MiB (100 %)   8.6 MiB/s in  6s ETA:  0s
info: downloading component 'rustfmt'
info: removing previous version of component 'rust-src'
info: removing previous version of component 'cargo'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rust-docs'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'rustc'
info: removing previous version of component 'rustfmt'
info: installing component 'rust-src'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
 15.1 MiB /  15.1 MiB (100 %)   2.1 MiB/s in  5s ETA:  0s
info: installing component 'rust-std'
 22.6 MiB /  22.6 MiB (100 %)  18.4 MiB/s in  1s ETA:  0s
info: installing component 'rustc'
 50.7 MiB /  50.7 MiB (100 %)  19.6 MiB/s in  2s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-aarch64-apple-darwin'

  stable-aarch64-apple-darwin updated - rustc 1.78.0 (9b00956e5 2024-04-29) (from rustc 1.74.0 (79e9716c9 2023-11-13))


Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).

To configure your current shell, you need to source
the corresponding env file under $HOME/.cargo.

This is usually done by running one of the following (note the leading DOT):
. "$HOME/.cargo/env"            # For sh/bash/zsh/ash/dash/pdksh
source "$HOME/.cargo/env.fish"  # For fish
 chovey@s1088757/Users/chovey> source "$HOME/.cargo/env.fish:"
source: Error encountered while sourcing file '/Users/chovey/.cargo/env.fish:':
source: No such file or directory
 chovey@s1088757/Users/chovey> source "$HOME/.cargo/env.fish"
 chovey@s1088757/Users/chovey> which cargo
/Users/chovey/.cargo/bin/cargo
 chovey@s1088757/Users/chovey> which rustup
/Users/chovey/.cargo/bin/rustup

Update

Rust updates occur every six weeks. To update Rust:

rustup update

Run

To run

$ rustc main.rs
$ ./main
Hello, world!

Tutorials

git clone https://github.com/kyclark/command-line-rust.git

Create and Run with Cargo

cargo new <project>

# example
cargo new hello

# run
cargo run
cargo run --quiet
cargo run -q

# just build
cargo build  # build, but not run

Test

cargo test

VS Code Extension

https://rust-analyzer.github.io/manual.html

"The Rust Programming Language" book

To get started, open the local "The Rust Programming Language" with

chovey@s1088757/Users/chovey/command-line-rust> rustup docs --book

which will open the local documentation in a web browser.

Anirudh 2024-01-26

Bookmarks

  • 2024-01-25: Finished through 3.4 Comments.
  • 2024-01-23: Finished Chapter 2, start next on Chapter 3.
  • 2024-01-12: file:///Users/chovey/.rustup/toolchains/stable-aarch64-apple-darwin/share/doc/rust/html/book/ch02-00-guessing-game-tutorial.html#testing-the-first-part

Deprecated

The previous installation, with bash (not fish):

bash-3.2$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

  /Users/chovey/.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory is located at:

  /Users/chovey/.cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
The bin directory for Cargo, located at:

  /Users/chovey/.cargo/bin

This path will then be added to your PATH environment variable by
modifying the profile files located at:

  /Users/chovey/.profile
  /Users/chovey/.bash_profile
  /Users/chovey/.zshenv

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: aarch64-apple-darwin
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

>1

info: profile set to 'default'
info: default host triple is aarch64-apple-darwin
info: syncing channel updates for 'stable-aarch64-apple-darwin'
info: latest update on 2023-11-16, rust version 1.74.0 (79e9716c9 2023-11-13)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
 14.4 MiB /  14.4 MiB (100 %)  12.4 MiB/s in  1s ETA:  0s
info: downloading component 'rust-std'
 24.1 MiB /  24.1 MiB (100 %)   7.8 MiB/s in  3s ETA:  0s
info: downloading component 'rustc'
 54.6 MiB /  54.6 MiB (100 %)   3.1 MiB/s in 15s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
 14.4 MiB /  14.4 MiB (100 %)   2.1 MiB/s in  4s ETA:  0s
info: installing component 'rust-std'
 24.1 MiB /  24.1 MiB (100 %)  19.2 MiB/s in  1s ETA:  0s
info: installing component 'rustc'
 54.6 MiB /  54.6 MiB (100 %)  21.2 MiB/s in  2s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-aarch64-apple-darwin'

  stable-aarch64-apple-darwin installed - rustc 1.74.0 (79e9716c9 2023-11-13)


Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
The bin directory for Cargo ($HOME/.cargo/bin).

To configure your current shell, run:
source "$HOME/.cargo/env"
bash-3.2$

rustschool's People

Contributors

hovey avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.