在 macOS Sierra 上安装 Rust 时无法写入 .bash_profile [英] Could not write to .bash_profile when installing Rust on macOS Sierra

查看:44
本文介绍了在 macOS Sierra 上安装 Rust 时无法写入 .bash_profile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过运行以下命令来安装 Rust:

I am trying to install Rust by running the following:

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

我不断收到以下错误:

could not write rcfile file: '/Users/pro/.bash_profile'
info: caused by: Permission denied (os error 13

推荐答案

尝试使用这个不使用 sudo:

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 

如果带有 --no-modify-path 选项的命令有效,您必须手动更新 .bash_profile 以将其包含在您的路径中:

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

这篇关于在 macOS Sierra 上安装 Rust 时无法写入 .bash_profile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆