[英]pod COMMAND(setup, init, install) showing “Permission denied” error on Macbook Pro with OS X 10.10.5
I'm getting "Permission denied" error when i am executing any command on terminal. 在终端上执行任何命令时,出现“权限被拒绝”错误。 The macbook which I'm using is running on OS X 10.10.5, and also this macbook is provide by my company so it having some permission levels. 我正在使用的Macbook在OS X 10.10.5上运行,并且此Macbook由我公司提供,因此具有一定的权限级别。 But I made my login as admin login. 但是我以管理员登录名登录。 When i'm executing "pod setup —verbose" command I'm getting below errors 当我执行“ pod setup -verbose”命令时,出现以下错误
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:959:in `read': Permission denied - /Library/Ruby/Gems/2.0.0/specifications/terminal-notifier-1.6.0.gemspec (Errno::EACCES)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:959:in `load'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:644:in `block (2 levels) in each_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:643:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:643:in `block in each_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:642:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:642:in `each_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:658:in `each_normal'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:669:in `_all'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:822:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:253:in `find_all'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:253:in `matching_specs'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:277:in `to_specs'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /usr/bin/pod:22:in `<main>'
I tried almost all the solutions available, but I didn't get the solution. 我尝试了几乎所有可用的解决方案,但没有得到解决方案。 Please help he on this. 请帮助他。
Update 更新资料
If i use the commands with sudo i am getting below errors. 如果我将命令与sudo一起使用,则会出现以下错误。
/Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:417:in `help!': [!] You cannot run CocoaPods as root. /Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:417:在`help!'中:[!]您不能以root身份运行CocoaPods。 (CLAide::Help) (CLAide :: Help)
Usage: 用法:
$ pod COMMAND
CocoaPods, the Cocoa library package manager.
Commands: 命令:
+ cache Manipulate the CocoaPods cache
+ init Generate a Podfile for the current directory.
+ install Install project dependencies to Podfile.lock versions
+ ipc Inter-process communication
+ lib Develop pods
+ list List pods
+ outdated Show outdated project dependencies
+ repo Manage spec-repositories
+ setup Setup the CocoaPods environment
+ spec Manage pod specs
+ update Update outdated project dependencies and create new Podfile.lock
Options: 选项:
--silent Show nothing
--version Show the version of the tool
--verbose Show more debugging information
--no-ansi Show output without ANSI codes
--help Show help banner of specified command
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/command.rb:44:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/bin/pod:44:in `<top (required)>'
from /usr/bin/pod:23:in `load'
I suggest you to look at this post 我建议你看看这篇文章
https://stackoverflow.com/a/14607772/5433235 https://stackoverflow.com/a/14607772/5433235
Did you try to install rvm https://rvm.io/rvm/install and then run 'pod install' ? 您是否尝试过安装rvm https://rvm.io/rvm/install ,然后运行“ pod install”?
Try to update permission on CocoaPods 尝试更新CocoaPods的权限
sudo chown -R $USER ~/Library/Caches/CocoaPods
sudo chown -R $USER ~/.cocoapods
Try running "pod install" and see if it fixed your problem. 尝试运行“ pod安装”,看看它是否解决了您的问题。
If you still getting permission denied, try: 如果仍然遭到拒绝,请尝试:
sudo chown -R $USER ./Pods
Also you might need to remove old podfile.lock before running pod install 另外,您可能需要在运行pod install之前删除旧的podfile.lock。
Depending on the Pod Update you are trying to run, the original folder that was downloaded may not have given you read/write access. 根据您尝试运行的Pod Update,下载的原始文件夹可能没有授予您读/写访问权限。 Navigate to that folder in Finder and right click to get info. 导航到Finder中的文件夹,然后右键单击以获取信息。 Go to permissions and check to see that your user name is listed and have read/write access. 转到权限并检查是否列出了您的用户名,并且具有读/写访问权限。 If not add your user name and give yourself the rights. 如果没有,请添加您的用户名并赋予自己权利。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.