Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my React Native Pod Install Erroring?

Trying to run pod install in a new React Native project and getting this error. Ruby is installed with brew

I have installed chruby and ruby-install, which I have then used to install ruby-2.7.5 cocopods, ffi and bundler. When trying bundler to install I get this error:

warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
fatal: not a git repository (or any of the parent directories): .git
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Fetching podspec for `hermes-engine` from `../node_modules/react-native/sdks/hermes/hermes-engine.podspec`
[!] Couldn't determine repo type for URL: `https://cdn.cocoapods.org/`: Permission bits for '/Users/macbook/.netrc' should be 0600, but are 644
like image 757
EddyWD Avatar asked Oct 18 '25 03:10

EddyWD


1 Answers

So I put out a bounty on this because I couldn't figure it out for ages. Until I did. (Hopefully this fix works for everyone else)

First when I ran xcode-select -p it was returning /Library/Developer/CommandLineTools

However this looked odd as another an answer here seemed to suggest that maybe this was causing an issue. It ended up that I just hadn't set my CLI tools correctly as described in the react native docs. Since it only had one option in the dropdown I assumed that the CLI tools were already set. However when I went back and specifically clicked on the one option, it made changes to my system.

Now running xcode-select -p returns /Application/Xcode.app/Contents/Developer

TL;DR : Open Xcode, go to 'Settings...' in the menu bar. Then go to the 'Locations' tab and click on the 'Command Line Tools' dropdown and click on the latest version (click on a version even if it seems like a version is already set). Now try your pod install again!

like image 180
SeanDemps Avatar answered Oct 20 '25 18:10

SeanDemps



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!