gem 安装权限被拒绝
无论我做什么,flutter doctor 总会返回:
[!] Xcode - develop for iOS and macOS (Xcode 13.3)
• Xcode at /Volumes/ssd/Applications/Xcode.app/Contents/Developer
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
当我跑步时,
$ gem install cocoapods
我得到: 错误:执行 gem 时... (Errno::EACCES) 权限被拒绝@ dir_s_mkdir - /Users/omkar/.local/share/gem/specs
我尝试使用
$ sudo chown -R /Users/omkar/.local/share/gem/*
密码:
但我得到: 用法: chown [-fhnvx] [-R [-H | -L | -P]] 所有者[:组] 文件 ... chown [-fhnvx] [-R [-H | ] -L | -P]] :group file ...
并且没有权限的问题仍然存在。
我怎样才能给予所需的许可?
更多信息: 我已按照这个答案安装brew 以下是输出:
$ which ruby
/usr/local/opt/ruby/bin/ruby
$ ruby -v
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-darwin21]
No matter what I do, flutter doctor always returns:
[!] Xcode - develop for iOS and macOS (Xcode 13.3)
• Xcode at /Volumes/ssd/Applications/Xcode.app/Contents/Developer
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
when I run
$ gem install cocoapods
I get:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ dir_s_mkdir - /Users/omkar/.local/share/gem/specs
I tried using
$ sudo chown -R /Users/omkar/.local/share/gem/*
Password:
But I got:
usage: chown [-fhnvx] [-R [-H | -L | -P]] owner[:group] file ...
chown [-fhnvx] [-R [-H | -L | -P]] :group file ...
and the issue of no permission still persists.
How can I give the required permission?
More info:
I have followed this answer to install brew
and following is the output:
$ which ruby
/usr/local/opt/ruby/bin/ruby
$ ruby -v
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-darwin21]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你尝试过使用
Did you try using
对于仍然遇到此问题的人,这解决了我的问题: https://mac.install.guide/ ruby/13.html
TLDR;
brew 安装 ruby
如果使用
zsh
,则open -e ~/.zshrc
,如果使用bash
,然后open -e ~/.bashrc
将这些行添加到末尾:
对于苹果英特尔:
对于Apple Silicon:
现在重新打开终端并输入
pod
,它应该按预期工作。for anyone still having this problem, this solved my problem: https://mac.install.guide/ruby/13.html
TLDR;
brew install ruby
if using
zsh
, thenopen -e ~/.zshrc
, if usingbash
, thenopen -e ~/.bashrc
add these lines to the end:
for Apple Intel:
for Apple Silicon:
now reopen the terminal and type
pod
and it should work as expected.