Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

ruby - Can't run sudo pod install after updating to cocoapods 0.32.1 with error "You cannot run CocoaPods as root. (CLAide::Help)"

I found an issue when running sudo pod install command after updating it to latest version 0.32.1. Earlier it was working very fine.

When I tried to do pod install with older cocoapods, it asked me to update to latest cocoapods version i.e. 0.32.1. After I updated by cocoapods gem, I can't do sudo pod install in my Xcode project. It gives me following error.

± sudo pod install                                                                                                            ruby-1.9.3-p0
Password:
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/claide-0.5.0/lib/claide/command.rb:328:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)

CocoaPods, the Objective-C library package manager.

Commands:....

Any suggestion to overcome the issue would be very helpful. Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had to update permission on CocoaPods

sudo chown -R $USER ~/Library/Caches/CocoaPods

sudo chown -R $USER ~/.cocoapods

Since it seems to fix the problem for some people, you might want to try running "pod install" and see if it fixed your problem from that point. However, I still had a permission denied when running "pod install" for a pod item, so running the next line will overwrite permission for the pod folder.

sudo chown -R $USER ./Pods

I have removed the old podfile.lock before running pod install

Source :

cocoaPods pod install Permission denied

https://github.com/CocoaPods/CocoaPods/issues/509


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...