0

I am trying to install pods for a react native app , but I can't install the pods. I tried several times with different approaches like the following:

  • sudo arch -x86_64 gem install ffi and arch -x86_64 pod install
  • or installing via rosetta terminal
  • or installing with homebrew
  • or switching to another ruby version (ruby-2.7.5) with rvm use

but pod install always fails with the following error message: incompatible library version - /Users/user/.rvm/gems/ruby-3.0.0/gems/ffi-1.15.5/lib/ffi_c.bundle it seems like the current ruby version is not compatible with the ffi and the cocoapods version.

Can anyone help me or have another idea why it does not work?

I think another problem could be that it uses different ruby versions within the process of installation because I have ruby installed with homebrew and on another location too.

tadman
  • 208,517
  • 23
  • 234
  • 262

1 Answers1

1

Steps to follow :

  1. remove pods from your system and install it via homebrew
  2. close the terminal and start new terminal
  3. remove node modules from the project
  4. remove pods folder in iOS
  5. remove Podfile.lock

For a clear understanding follow this solution

shim
  • 9,289
  • 12
  • 69
  • 108
abdemirza
  • 629
  • 4
  • 16
  • This is what I had to do, too. Completely expunge Homebrew and start over. If you don't you'll be stuck with a mix of x86_64 and ARM builds that don't work together properly. – tadman Oct 01 '22 at 23:25
  • Hey thank you! i will try... with which command did you remove the pods from your system exactly? `gem uninstall cocoapods` returns: `Gem 'cocoapods' is not installed` – Juliane Mohr Oct 02 '22 at 10:54
  • So I did all the steps and then tried to install the pods with "pod install" again, but that didn't work because `No 'Podfile' found in the project directory.`. – Juliane Mohr Oct 02 '22 at 17:39
  • Then I ran `pod init` and `pod install`again, but i get the same error as before `:85:in 'require': incompatible library version - /Users/user/.rvm/gems/ruby-3.0.0/gems/ffi-1.15.5/lib/ffi_c.bundle (LoadError) from :85:in 'require'` – Juliane Mohr Oct 02 '22 at 17:46
  • 1
    Follow the link mentioned in my answer. – abdemirza Oct 02 '22 at 18:25
  • Okey thank you. I tried running the commands of this post "https://stackoverflow.com/a/66771694/17671494" but I couldn't run pod install because there was no ruby version with homebrew anymore... i have them only installed with rvm but i uninstalled the homebrew version and so it says `Could not find proper version of cocoapods (1.11.3) in any of the sources` and after running: rvm install: `Your Ruby version is 3.0.0, but your Gemfile specified 2.7.4`. – Juliane Mohr Oct 03 '22 at 17:29
  • Now I can't install this ruby version because an error ocurred during the installation, which says: `Error running './configure --prefix=/Users/user/.rvm/rubies/ruby-2.7.4 --with-opt-dir=/opt/homebrew/opt/libyaml:/opt/homebrew/opt/libksba:/opt/homebrew/opt/readline:/opt/homebrew/opt/zlib:/opt/homebrew/opt/openssl@1.1 --disable-install-doc --enable-shared',` – Juliane Mohr Oct 03 '22 at 17:30