Cocoa Pods 没有在 El Capitan 上更新 pods
Cocoa Pods not updating pods on El Capitan
我已经升级到 El Capitan,从那以后我无法更新我的 pods。
$ pod update
-bash: pod: command not found
所以我尝试重新安装 CocoaPods 并得到了这个:
$ sudo gem install cocoapods
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj
我是这台电脑的管理员。为什么会这样?
你有没有重新安装 Xcode 命令行工具?那解决了我的问题。您需要在 Xcode 首选项(位置)中 select 命令行工具,然后安装 cocoa pods.
这是由 El Capitan 中引入的新 System integrity protection 功能引起的。它甚至限制管理员写入 /usr/bin
。
您最好的选择是安装 gems 而无需 sudo
。有个不错的guide on how to do that:
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH
gem install cocoapods
这应该适合你
sudo gem install -n /usr/local/bin cocoapods
Operation not permitted - /usr/bin/xcodeproj #3692
For whatever reason, the rootless stuff seems less restrictive when one simply upgrades the system. I could sudo gem install cocoapods just fine on a machine upgraded from 10.10 - however, binstubs are no longer installed into /usr/bin:
$ sudo gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:/Library/Ruby/bin
$ pod --version
0.37.2
We have heard from some users that they receive this error when doing a system-wide installation:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/pod
We aren't sure why gem behaves differently on some systems, but this can be solved by passing -n /usr/local/bin
to the install command, so that the pod executable gets installed there.
安装 Pods 自定义和标准安装的最佳选择
参考 Link :https://github.com/CocoaPods/CocoaPods/issues/3692
关于原文question/problem:
$ sudo gem install cocoapods
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted
我发现 几个 GEMS 也有同样的问题,所以我概括了公认的答案 (Keith Smiley) 来更新所有本地 gems...(在 El无根的船长)
$ sudo gem install cocoapods -n /usr/local/bin/ # this command installs
$ sudo gem update -n /usr/local/bin/ # this command updates all local gems
这很好用,会吐出所有更新和错误的详细日志。
我看到了许多错误。它们都是 'unable to convert' 个错误。解析很多文档会遇到"skipping"错误...像这样:
$ unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/jazzy... skipping
我相信这些跳过错误不是问题。
在此过程中,CocoaPods 将与所有其他本地 GEMS 一起更新,具体取决于您本地 GEMS 的最新情况。我相信这是处理无根问题(这是问题的原因)的最佳方法。
对我来说,它适用于:
sudo gem install -n /usr/local/bin cocoapods --pre
卸载所有 cocopods 实例(只是为了安全和保持清洁)参见 fully uninstall Cocoapods
sudo gem uninstall cocoapods
甚至更好地完全卸载所有组件(以及 select 每个组件的所有版本)
gem list --local | grep cocoapods | awk '{print }' | xargs sudo gem uninstall
重新安装
sudo gem install -n /usr/local/bin cocoapods
更改访问权限
sudo chmod +rx /usr/local/bin/
我已经升级到 El Capitan,从那以后我无法更新我的 pods。
$ pod update
-bash: pod: command not found
所以我尝试重新安装 CocoaPods 并得到了这个:
$ sudo gem install cocoapods
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj
我是这台电脑的管理员。为什么会这样?
你有没有重新安装 Xcode 命令行工具?那解决了我的问题。您需要在 Xcode 首选项(位置)中 select 命令行工具,然后安装 cocoa pods.
这是由 El Capitan 中引入的新 System integrity protection 功能引起的。它甚至限制管理员写入 /usr/bin
。
您最好的选择是安装 gems 而无需 sudo
。有个不错的guide on how to do that:
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH
gem install cocoapods
这应该适合你
sudo gem install -n /usr/local/bin cocoapods
Operation not permitted - /usr/bin/xcodeproj #3692
For whatever reason, the rootless stuff seems less restrictive when one simply upgrades the system. I could sudo gem install cocoapods just fine on a machine upgraded from 10.10 - however, binstubs are no longer installed into /usr/bin:
$ sudo gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:/Library/Ruby/bin
$ pod --version
0.37.2
We have heard from some users that they receive this error when doing a system-wide installation:
ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod
We aren't sure why gem behaves differently on some systems, but this can be solved by passing
-n /usr/local/bin
to the install command, so that the pod executable gets installed there.
安装 Pods 自定义和标准安装的最佳选择 参考 Link :https://github.com/CocoaPods/CocoaPods/issues/3692
关于原文question/problem:
$ sudo gem install cocoapods
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted
我发现 几个 GEMS 也有同样的问题,所以我概括了公认的答案 (Keith Smiley) 来更新所有本地 gems...(在 El无根的船长)
$ sudo gem install cocoapods -n /usr/local/bin/ # this command installs
$ sudo gem update -n /usr/local/bin/ # this command updates all local gems
这很好用,会吐出所有更新和错误的详细日志。
我看到了许多错误。它们都是 'unable to convert' 个错误。解析很多文档会遇到"skipping"错误...像这样:
$ unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/jazzy... skipping
我相信这些跳过错误不是问题。
在此过程中,CocoaPods 将与所有其他本地 GEMS 一起更新,具体取决于您本地 GEMS 的最新情况。我相信这是处理无根问题(这是问题的原因)的最佳方法。
对我来说,它适用于: sudo gem install -n /usr/local/bin cocoapods --pre
卸载所有 cocopods 实例(只是为了安全和保持清洁)参见 fully uninstall Cocoapods
sudo gem uninstall cocoapods
甚至更好地完全卸载所有组件(以及 select 每个组件的所有版本)
gem list --local | grep cocoapods | awk '{print }' | xargs sudo gem uninstall
重新安装
sudo gem install -n /usr/local/bin cocoapods
更改访问权限
sudo chmod +rx /usr/local/bin/