DEV Community

John Behan
John Behan

Posted on • Originally published at boxitoff.com

Getting started with Rust on Mac

The Easy WayTM to Install Rust (on a Mac)

The easiest way to install Rust on a Mac is to head on over to https://www.rust-lang.org/tools/install and use the shell command there -

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

But...

Sometimes we get the following error -

Unknown SSL protocol error in connection to static.rust-lang.org

Sometimes. I got this on my work machine but not my personal one.

You can read a bit about this issue here - https://www.wormly.com/answers/sid/142/topicid/19

There is a fairly straightforward solution

The Fairly Easy WayTM to Install Rust (on a Mac)

(See Update below before trying this)

We want to use rustup so let's get that first.

brew install rustup

Next let's setup cargo and rustc,

rustup-init

Finally we can check our installation with - rustc --version

UPDATE

jeikabu on Dev.to has given this tip to try.

The old way of installing rustup - curl sh.rustup.rs -sSf | sh

I haven't tested this but it is worth trying before falling back on brew.

Top comments (5)

Collapse
 
jeikabu profile image
jeikabu

Using brew to run a shell script seems like overkill, can you just use the old command:
curl sh.rustup.rs -sSf | sh

Collapse
 
jjmax75 profile image
John Behan

Yes, that is definitely the preferred approach and worked on one of my machines.

The second approach is only for when that doesn't work

Collapse
 
jeikabu profile image
jeikabu • Edited

I mean, it's a known potential issue with macOS and client-side certificates, just don't use TLS. No need for brew.

Thread Thread
 
jjmax75 profile image
John Behan

cool, I'll add that to the article, thanks :D

Collapse
 
todddsm profile image
Todd Thomas • Edited

Erroneous. Brew everything; upgrades are easier. I was looking for these steps though. Thanks.