gpt4 book ai didi

ios - 从 Xcode cocoapods 插件运行 pod install

转载 作者:技术小花猫 更新时间:2023-10-29 11:18:50 32 4
gpt4 key购买 nike

我正在尝试从 Xcode cocoapods plugin 运行 pod install 命令.

当我运行更新/安装 cocoapods 命令时出现错误:

/usr/bin/gem install cocoapods

ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

这很奇怪,好像我转到终端中的目录并运行 pod install 我没有任何问题。

要注意的是,错误是指 Ruby 2.0.0,而当我从终端目录运行 ruby -v 命令时,我得到 (ruby 1.9.3p327 ( 2012-11-10 修订版 37606) [x86_64-darwin12.4.0])

编辑 - 根据要求:

ls -la /Library/Ruby/Gems  
total 0
drwxr-xr-x 4 root wheel 136 27 Oct 23:39 .
drwxr-xr-x 4 root wheel 136 27 Oct 23:36 ..
drwxr-xr-x 6 root wheel 204 25 Aug 02:44 1.8
drwxr-xr-x 2 root wheel 68 25 Aug 04:13 2.0.0

最佳答案

这是 Mavericks 特有的,默认的 Ruby 已升级到 2.0.0,并且您之前已经将 CocoaPods 与以前版本的 Ruby 一起使用。解决方法是以 root 身份运行 gem install cocoapods 命令,而不是以使用 sudo 的登录用户身份运行。

从终端运行 sudo -sroot 用户身份进入 shell。然后运行 ​​gem install cocoapods。现在您可以从 CocoaPods 插件运行 Run Update/Install

关于ios - 从 Xcode cocoapods 插件运行 pod install,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19957444/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com