Search code examples
iosrubyreact-nativecocoapodsrbenv

Pod install is no longer working in one of my react-native projects


I was working on a react-native app a few months back, I've just resumed work on it and I'm having issues with pod install. In the meantime, I've been working on other projects while this was on pause and pod install works just fine so this would suggest this is not an environment issue.

The error I am getting is as follows:

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>'

Any help or advice would be greatly appreciated.


Solution

  • I managed to find the solution myself. I don't fully understand why it was working for some projects and not other - perhaps one of you could add to this.

    In short, I made sure I only had one ruby version installed in my system. There was multiple 2 versions conflicting with each other with no virtual control to manage the active version.