CraigSau
CraigSau

Reputation: 181

`rescue in block in activate_dependencies': Could not find 'rexml' (>= 0) among 117 total gem(s) (Gem::MissingSpecError)

Having an issue when running pod install in my ReactNative iOS application, as the build fails when trying to run the emulator. These are the two errors that occur when doing so. Running this locally on a 2021 M1 Macbook Pro, and it is my first time attempting to build a ReactNative application, and setting up the development environment, so any help in pointing me in the right direction is appreciated. If you need any additional info, please let me know and I'll do my best to provide it ASAP.

`rescue in block in activate_dependencies': Could not find 'rexml' (>= 0) among 117 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/craigsau/.rvm/gems/ruby-2.7.5:/Users/craigsau/.rvm/rubies/ruby-2.7.5/lib/ruby/gems/2.7.0:/opt/homebrew/Cellar/cocoapods/1.11.3/libexec' at: /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/specifications/CFPropertyList-3.0.5.gemspec, execute `gem env` for more information
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1398:in `block in activate_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1387:in `each'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1387:in `activate_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1369:in `activate'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1405:in `block in activate_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1387:in `each'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1387:in `activate_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1369:in `activate'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1405:in `block in activate_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1387:in `each'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1387:in `activate_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1369:in `activate'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems.rb:286:in `block in activate_bin_path'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems.rb:285:in `synchronize'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems.rb:285:in `activate_bin_path'
    from /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `<main>'
Could not find 'rexml' (>= 0) among 117 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/craigsau/.rvm/gems/ruby-2.7.5:/Users/craigsau/.rvm/rubies/ruby-2.7.5/lib/ruby/gems/2.7.0:/opt/homebrew/Cellar/cocoapods/1.11.3/libexec' , execute `gem env` for more information
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1399:in `block in activate_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1387:in `each'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1387:in `activate_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1369:in `activate'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1405:in `block in activate_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1387:in `each'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1387:in `activate_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1369:in `activate'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1405:in `block in activate_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1387:in `each'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1387:in `activate_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems/specification.rb:1369:in `activate'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems.rb:286:in `block in activate_bin_path'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems.rb:285:in `synchronize'
    from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/rubygems.rb:285:in `activate_bin_path'
    from /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `<main>'

attempted running the commands gem install bundler gem update --system but still giving the same errors when trying to run the pod install command in order to fix the build when trying to run the ReactNative template through an emulator.

Upvotes: 17

Views: 11708

Answers (2)

Matt Fletcher
Matt Fletcher

Reputation: 9220

It sounds like your issue may be the same as mine- simply that the version of ruby that brew has installed cocoapods against is not the same as the version you have active in rvm. Consider the difference:

GEM_PATH=/Users/craigsau/.rvm/gems/ruby-2.7.5          # rvm's ruby:  version 2.7
from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0  # brew's ruby: version 3.1

I fixed this for myself by upgrading ruby in nvm to the later version that homebrew is using. In your case it would be

rvm install 3.1.2

Upvotes: 3

ethanneff
ethanneff

Reputation: 3431

run the following command

gem cleanup
brew uninstall cocoapods
sudo gem uninstall cocoapods
sudo gem install cocoapods
cd ios
pod install --repo-update

Upvotes: 36

Related Questions