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

lqfhib0f  于 2023-05-17  发布在  Ruby
关注(0)|答案(4)|浏览(369)

我最近更新到了rubyv2.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,但没有帮助。
有没有人遇到过类似的问题,并找到了解决方案?感谢期待。

ovfsdjhp

ovfsdjhp1#

看起来你需要安装gem xcodeproj,在终端运行:gem install xcodeproj,see here

pobjuy32

pobjuy322#

使用\curl -sSL https://get.rvm.io安装RVM| bash -s stable;重新启动你的shell;使用rvm install 2.6安装Ruby。
gem install可可pods
do:pod安装
这对我很有效

inkz8wg9

inkz8wg93#

在NativeScript 6.5上执行tns migrate之后,我就发生了这种情况,并且在运行命令之前,我一直构建得很好。
我通过运行tns doctor修复了这个问题,它说我的cocoapods安装丢失了。所以tns医生自动进入重新安装模式来尝试修复问题,我让它重新安装cocoapods和xcodeproj。
菲什

9avjhtql

9avjhtql4#

sudo gem install cocoapods && pod install

相关问题