我已经用新版本更新了MacBook Pro中的Mac操作系统。更新后,Pod-init不工作。
我使用的是版本13.0(22A380(Ventura[15英寸,2019]型号。请帮我把它做完。下面我得到以下错误
Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String (FrozenError)
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `report'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:66:in `report_error'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:228:in `initialize_from_file': [Xcodeproj] Unknown object version (56). (RuntimeError)
from /Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:113:in `open'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/init.rb:41:in `validate!'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:333:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'
当我试图运行上述命令时。然后我得到以下错误。
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
如果我正在尝试获得上述文件夹的权限,则会出现以下错误。
命令:chmod ugo+rwx /Library/Ruby/Gems/2.6.0
结果
chmod: Unable to change file mode on /Library/Ruby/Gems/2.6.0: Operation not permitted
在Xcode中打开您的项目,在"项目文档"下,将"项目格式"更改为兼容XCode13.0。然后关闭该项目,然后重试pod init。
您似乎使用了系统ruby。尽量避免这种情况,安装rbenv
或rvm
来管理您的ruby版本。有关不应使用system ruby的更多信息,请参阅:https://mac.install.guide/faq/do-not-use-mac-system-ruby/index.html
更新到macOS 13.0:后,这对我来说很有效
-
安装自制
/bin/bash-c"$(卷曲-fsSLhttps://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)">
-
安装可可荚
酿造设备
-
然后这个:
pod设置——详细
错误消息"未知对象版本(56(";这意味着工作的宝石和活动的之间存在不兼容
一个循序渐进的解决方案是:
- 打开终端并转到包含.xcodeproj文件的项目文件夹
- 通过在终端中运行命令
xcode-select -p
来检查激活的Xcode路径 - 打开您遇到问题的Xcode项目文件
- 如果项目文件成功打开,请导航到项目中包含Podfile的目录。(如果你找不到"我的案例",就忽略它,进入第5步(
- 运行命令
gem update xcodeproj
将Xcodeproj gem更新到最新版本。如果它有权限问题,请使用类似于sudo的:sudo gem update xcodeproj
来运行它 - 运行命令
pod install
以安装任何必要的依赖项并更新您的项目。(如果步骤4中没有podfile,则在运行pod install之前,必须使用命令pod init
( - 已完成