【发布时间】:2018-08-14 10:41:57
【问题描述】:
在 mac 上运行 rbenv init 时挂断了编辑 .bash_profile。
$ rbenv init
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
但得到消息: -bash: /Users/macbookpro/.bash_profile: 权限被拒绝
我尝试直接编辑 .bash_profile 但收到消息:
我找到了这个命令来查看用户:
$ ls -la ~ | grep bash
它显示:
-rw------- 1 macbookpro .bash_history
-rw-r--r-- 1 root .bash_profile
如果我使用命令打开文件:
$ sudo nano ~/.bash_profile
我想我需要将它添加到 .bash_profile:
$ export PATH="$HOME/.rbenv/bin:$PATH"
或者它只是它的内部“部分”? 另外,我该如何保存或者我们有更简单的解决方案(假装我的名字是 Fname-Lname)?
【问题讨论】:
-
我可以把它带回我的所有权或共享吗?