pod 安装失败,并显示“无法加载此类文件 - xcodeproj”

问题描述 投票:0回答:4

我最近更新到 ruby v 2.6 升级后,我在安装 pod 时遇到问题,并出现以下错误

Traceback (most recent call last):
    7: from /usr/local/bin/pod:23:in `<main>'
    6: from /usr/local/bin/pod:23:in `load'
    5: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:36:in `<top (required)>'
    4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    2: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods.rb:2:in `<top (required)>'
    1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- xcodeproj (LoadError)
    8: from /usr/local/bin/pod:23:in `<main>'
    7: from /usr/local/bin/pod:23:in `load'
    6: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:36:in `<top (required)>'
    5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    3: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods.rb:2:in `<top (required)>'
    2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
    1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `require': cannot load such file -- xcodeproj (LoadError)

我已经尝试过

sudo gem install cocoapods
但没有帮助。

有人遇到类似问题并找到解决方案吗?

ruby xcode frameworks
4个回答
40
投票

似乎你需要安装 gem xcodeproj,在终端中运行:

gem install xcodeproj

看这里


5
投票

只有这个对我有用:

sudo gem install cocoapods --user-install

0
投票

sudo gem install cocoapods && pod install


0
投票

安装 RVM

© www.soinside.com 2019 - 2024. All rights reserved.