Pod install 在我的一个 react-native 项目中不再有效

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

几个月前我正在开发一个反应本机应用程序,我刚刚恢复了它的工作并且我遇到了 pod 安装问题。 与此同时,我一直在从事其他项目,而这是暂停的,并且 pod install 工作得很好,所以这表明这不是环境问题。

我得到的错误如下:

Ignoring json-2.6.3 because its extensions are not built. Try: gem pristine json -- 
    version 2.6.3
 <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require': dlopen(/Users/plafferty/.gem/ruby/2.7.6/gems/date-3.3.3/lib/date_core.bundle, 0x0009): symbol not found in flat namespace '_rb_empty_keyword_given_p' - /Users/plafferty/.gem/ruby/2.7.6/gems/date-3.3.3/lib/date_core.bundle (LoadError)
        from <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
        from /Users/plafferty/.gem/ruby/2.7.6/gems/date-3.3.3/lib/date.rb:4:in `<top (required)>'
        from <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
        from <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
        from /opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/time.rb:4:in `<top (required)>'
        from <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
        from <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
        from /opt/homebrew/Cellar/cocoapods/1.11.3_1/libexec/gems/activesupport-6.1.7/lib/active_support/xml_mini.rb:3:in `<top (required)>'
        from <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
        from <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
        from /opt/homebrew/Cellar/cocoapods/1.11.3_1/libexec/gems/activesupport-6.1.7/lib/active_support/core_ext/array/conversions.rb:3:in `<top (required)>'
        from <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
        from <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
        from /opt/homebrew/Cellar/cocoapods/1.11.3_1/libexec/gems/cocoapods-1.11.3/lib/cocoapods.rb:9:in `<top (required)>'
        from <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
        from <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
        from /opt/homebrew/Cellar/cocoapods/1.11.3_1/libexec/gems/cocoapods-1.11.3/bin/pod:36:in `<top (required)>'
        from /opt/homebrew/Cellar/cocoapods/1.11.3_1/libexec/bin/pod:25:in `load'
        from /opt/homebrew/Cellar/cocoapods/1.11.3_1/libexec/bin/pod:25:in `<main>'

任何帮助或建议将不胜感激。

ios ruby react-native cocoapods rbenv
1个回答
0
投票

我设法自己找到了解决方案。 我不完全理解为什么它适用于某些项目而不适用于其他项目 - 也许你们中的一个可以添加到这里。

简而言之,我确保我的系统中只安装了一个 ruby 版本。 有多个 2 版本相互冲突,没有虚拟控制来管理活动版本。

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