Skip to content

Instantly share code, notes, and snippets.

@daniloab
Created October 15, 2021 02:51
Show Gist options
  • Save daniloab/5f2945e6f472c0dae45cc123b8c67f03 to your computer and use it in GitHub Desktop.
Save daniloab/5f2945e6f472c0dae45cc123b8c67f03 to your computer and use it in GitHub Desktop.

Hi there, Im trying to configure my react native environment on my Macbook M1. When trying to create a new react native project from Cli returns:

creating

npx react-native init RnRQYPoc --template react-native-template-typescript

...

✔ Downloading template
✔ Copying template
✔ Processing template
✖ Installing CocoaPods dependencies (this may take a few minutes)
✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./RnRQYPoc/ios && pod install".
CocoaPods documentation: https://cocoapods.org/

So, googling I found this issue: CocoaPods/CocoaPods#10287 (comment) and I already tried the two solutions:

Solution 1:

Duplicate the Terminal application in the Utilities folder.
Right click on the app and choose Get Info.
Rename the other version of the app as you like.
Check the option "open with Rosetta".
Install Cocoapods with the command "sudo gem install cocoapods"
Type the command line "sudo gem install ffi" to fix the ffi bundle problem. Now you can do a "pod install" without problem.

and

Solution 2:

sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

But, both does not work returning the following errors:

gist cocoapods errors

Does anyone knows how can I fix this?

@daniloab
Copy link
Author

Fixed the installation of pod install doing the following:

    1. brew install cocoapods
    1. sudo arch -x86_64 gem install ffi
    1. arch -x86_64 pod install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment