简体   繁体   English

chown错误,尝试使用Ruby 2.0.0在Mavericks中安装rbenv

[英]chown Error trying to install rbenv in Mavericks, using Ruby 2.0.0

Trying to install rbenv. 尝试安装rbenv。

1. Checked to See brew update 1.检查以查看酿造更新

Started with: 开始于:

$ brew update    

then got: 然后得到:

fatal: Not a git repository (or any of the parent directories): .git 致命:不是git存储库(或任何父目录):.git

So then I did: 所以我做了:

$ git init brew update  

and got: 并得到:

usage: git init [-q | 用法:git init [-q | --quiet] [--bare] [--template=] [--shared[=]] [directory] --quiet] [--bare] [--template =] [--shared [=]] [目录]

which i assume means it worked. 我认为这意味着它的工作。

2. Tried Installing rbenv 2.尝试安装rbenv

Next I did: 接下来,我做了:

 $ brew install rbenv  

And got this: 并得到了:

==> Downloading https://github.com/sstephenson/rbenv/archive/v0.4.0.tar.gz ==>下载https://github.com/sstephenson/rbenv/archive/v0.4.0.tar.gz

################################################################## 100.0% ################################################## ################ 100.0%

==> Caveats ==>注意事项
To use Homebrew's directories rather than ~/.rbenv add to your profile: 要使用Homebrew的目录而不是〜/ .rbenv添加到您的配置文件:
export RBENV_ROOT=/usr/local/var/rbenv 导出RBENV_ROOT = / usr / local / var / rbenv

To enable shims and autocompletion add to your profile: 要启用填充和自动补全功能,请添加到您的配置文件中:
if which rbenv > /dev/null; 如果哪个rbenv> / dev / null; then eval "$(rbenv init -)"; 然后评估“ $(rbenv init-)”; fi 科幻
Warning: Could not link rbenv. 警告:无法链接rbenv。 Unlinking... 取消链接...
Error: The brew link step did not complete successfully 错误: brew link步骤未成功完成
The formula built, but is not symlinked into /usr/local 公式已建立,但未符号链接到/ usr / local
You can try again using `brew link rbenv' 您可以使用“ brew link rbenv”重试

Possible conflicting files are: 可能冲突的文件是:
==> Summary ==>摘要
🍺 /usr/local/Cellar/rbenv/0.4.0: 31 files, 152K, built in 2 seconds 🍺/usr/local/Cellar/rbenv/0.4.0:31个文件,152K,内置2秒

3. So I tried to Link rbenv 3.所以我试图链接rbenv

Tried to link rbenv: 试图链接rbenv:

$ brew link rbenv  

And got this message: 并得到此消息:

Linking /usr/local/Cellar/rbenv/0.4.0... Warning: Could not link rbenv. 链接/usr/local/Cellar/rbenv/0.4.0 ...警告:无法链接rbenv。 Unlinking... 取消链接...

Error: Could not symlink file: /usr/local/Cellar/rbenv/0.4.0 错误:无法符号链接文件:/usr/local/Cellar/rbenv/0.4.0
/usr/local/Library/LinkedKegs is not writable. / usr / local / Library / LinkedKegs不可写。 You should change its permissions. 您应该更改其权限。

4. Finally, tried to change ownership 4.最后,尝试更改所有权

Finally I tried to chown to change permission: 最后,我尝试修改权限:

$ chown -R s****i /usr/local/Library/LinkedKegs  

And got these messages: 并得到以下消息:

chown: /usr/local/Library/LinkedKegs/apple-gcc42: Operation not permitted chown:/ usr / local / Library / LinkedKegs / apple-gcc42:不允许操作
chown: /usr/local/Library/LinkedKegs/autoconf: Operation not permitted chown:/ usr / local / Library / LinkedKegs / autoconf:不允许操作
chown: /usr/local/Library/LinkedKegs/automake: Operation not permitted chown:/ usr / local / Library / LinkedKegs / automake:不允许操作
chown: /usr/local/Library/LinkedKegs/git: Operation not permitted chown:/ usr / local / Library / LinkedKegs / git:不允许操作
chown: /usr/local/Library/LinkedKegs/libgpg-error: Operation not permitted chown:/ usr / local / Library / LinkedKegs / libgpg-错误:不允许操作
chown: /usr/local/Library/LinkedKegs/libksba: Operation not permitted chown:/ usr / local / Library / LinkedKegs / libksba:不允许操作
chown: /usr/local/Library/LinkedKegs/libtool: Operation not permitted chown:/ usr / local / Library / LinkedKegs / libtool:不允许操作
chown: /usr/local/Library/LinkedKegs/libyaml: Operation not permitted chown:/ usr / local / Library / LinkedKegs / libyaml:不允许操作
chown: /usr/local/Library/LinkedKegs/pkg-config: Operation not permitted chown:/ usr / local / Library / LinkedKegs / pkg-config:不允许操作
chown: /usr/local/Library/LinkedKegs: Operation not permitted chown:/ usr / local / Library / LinkedKegs:不允许操作

Question

I'm (clearly) very new to Terminal, and setting up Ruby. 我(显然)对Terminal非常陌生,并设置了Ruby。 Can someone tell me what I am doing wrong here and how to fix it? 有人可以告诉我我在这里做错什么以及如何解决吗?

By way of background, I imploded rvm as per the instructions I'm following, and now trying to install rbenv. 作为背景,我按照我遵循的说明对rvm进行了内插,现在尝试安装rbenv。 Not even sure why, but it seems to be the au courant thing to do. 甚至不知道为什么,但这似乎是最明智的选择。

Try to force the ownership change on /usr/local/ but take note of the current owner ( ls -l /usr/local ) in the case of problems: and try chown -R $(whoami) /usr/local (append with sudo ) to elevate the command as an admin if this doesn't work [nb. 尝试在/usr/local/上强制更改所有权,但是在出现问题的情况下记下当前所有者( ls -l /usr/local ):并尝试chown -R $(whoami) /usr/local (附加sudo ),如果不起作用,则以管理员身份提升命令[nb。 -R will run the ownership change recursively]. -R将递归运行所有权更改]。 Then try brew link rbenv again. 然后再次尝试brew link rbenv

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM