cocoaPods pod install权限被拒绝 [英] cocoaPods pod install Permission denied

查看:418
本文介绍了cocoaPods pod install权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是简短的版本:



当我运行

  pod安装

在Xcode项目中获得




波德::可执行拉错误[!]:无法打开的.git / FETCH_HEAD:
权限被拒绝




如果我运行

  sudo pod install 

我没有遇到任何错误,但是我安装的文件由root拥有,无法编译,我必须 chown 这些文件给普通用户使用Xcode编译器。



我正在运行Lion OSX。



I安装的CocoaPods使用

 须藤宝石安装的CocoaPods 

我不得不使用 sudo ,因为没有它,我得到了


错误:执行gem时(Gem :: FilePermissionError)



您没有写入/ Library / Ruby / Gems / 1.8直接ry。

所以现在我有一个root安装版本的cocoaPods,用于下载根拥有的Xcode库。



sudo 安装cocoaPods的方式是错误的还是正常的?

如果正常,有没有办法解决pod安装问题?

解决方案我通过运行以下命令解决了这个问题:

  sudo chown -R用户名:groupname〜/ Library / Caches / CocoaPods 

  sudo chown -R用户名:groupname〜/ .cocoapods 

请替换用户名 groupname 与您的Mac登录用户名/组名称。


This is the short version:

When I run

pod install 

in an Xcode project I get

[!] Pod::Executable pull error: cannot open .git/FETCH_HEAD: Permission denied

If I run

sudo pod install

I get no error, but my files installed are owned by root and can't compile and I have to chown those files to a normal user to use the Xcode compiler.

I am running Lion OSX.

I installed cocoaPods using

sudo gem install cocoaPods

I had to use sudo because without it I got

ERROR: While executing gem ... (Gem::FilePermissionError)

You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.

so now I have a root installed version of cocoaPods that downloads root owned Xcode libraries.

Is sudo installation of cocoaPods the wrong way or normal way?

If normal, is there a way to fix the pod install problem?

解决方案

I solved this problem by running the following command:

sudo chown -R username:groupname ~/Library/Caches/CocoaPods

and

sudo chown -R username:groupname ~/.cocoapods

Please replace username and groupname with your Mac login username/groupname.

这篇关于cocoaPods pod install权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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