Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not write to .bash_profile when installing Rust on macOS Sierra

I am trying to install Rust by running the following:

sudo curl https://sh.rustup.rs -sSf | sh

I keep getting this following error:

could not write rcfile file: '/Users/pro/.bash_profile'
info: caused by: Permission denied (os error 13
like image 702
Samuel Dare Avatar asked Aug 26 '17 21:08

Samuel Dare


People also ask

Where can I find .bash_profile in Mac?

The . bash_profile files on Mac are located in the Finder app's home directory. It is usually invisible. You can press "Command" + "Shift" + "." together to find the hidden files on your Mac.

What is the .bash_profile in Mac?

In simple words, bash_profile is a configuration file for the Bash shell, which is a hidden file in your Mac's user directory. The bash profile on Mac has loaded before Terminal loads your shell environment and contains all the startup configuration and preferences for your command-line interface.

Can you install rust on Mac?

Rust is a survival game playable on Mac through its official macOS version. Alternatively, you can also run Rust on your Mac using cloud gaming services such as GeForce or Boosteroid, in which case you won't even need to download the game.


1 Answers

Give a try using this not using sudo:

curl https://sh.rustup.rs -sSf | sh -s -- --help

If that works then probably you could try:

curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path 

If the command with the --no-modify-path option works, you'll have to manually update .bash_profile to include it in your path:

source ~/.cargo/env
like image 112
nbari Avatar answered Oct 13 '22 20:10

nbari