Quantcast
Channel: Active questions tagged cocoapods - Stack Overflow
Viewing all articles
Browse latest Browse all 1021

CocoaPods and Ruby Compatibility Issues with Flutter 2.6 on M1 Mac (Pod Install Fails)

$
0
0

I have a Flutter project from 2021 that I need to rebuild without upgrading dependencies. To manage different Flutter versions, I installed FVM and switched to Flutter 2.6 to build for iOS.

However, when I try to run pod install in the ios directory, I encounter the following error:

[!] Invalid `Podfile` file: undefined method `exists?' for class `File`.

My Current Environment:

  • Mac: M1 (Apple Silicon) with Rosetta enabled
  • Flutter: 2.6 (using FVM)
  • Ruby: 3.3.6 (default system Ruby)
  • CocoaPods: 1.11.3 (installed via sudo gem install cocoapods -v 1.11.3)

Questions:

  1. How can I successfully install Ruby 2.7.5 on my M1 Mac given that OpenSSL 1.1 is deprecated in Homebrew?
  2. Is there a workaround to make CocoaPods 1.11.3 work with Ruby 3.3.6?
  3. How can I resolve the undefined method 'exists?' for class 'File' error during pod install?
  4. Is there any hope that I can run that project without having to dig deep in that wormhole of a codebase?

Any help or guidance would be greatly appreciated!

What I Have Tried:

  1. Reinstalling Everything:
    I reinstalled Flutter, FVM, Ruby, and CocoaPods.

  2. Switching to Ruby 2.7.5:
    I know CocoaPods 1.11.3 is compatible with Ruby 2.7.x, so I tried to install Ruby 2.7.5 using rbenv:

    rbenv install 2.7.5

    However, the installation fails with errors related to OpenSSL. I get messages like:

    Error: openssl@1.1 has been disabled because it is not supported upstream! It was disabled on 2024-10-24.
  3. Attempted Fixes for rbenv:

    • Installed dependencies using Homebrew:
      arch -arm64 brew install openssl@1.1 readline libyaml gmp zlib
    • Tried various environment configurations:
      export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"
    • Attempted to install using Rosetta:
      arch -x86_64 rbenv install 2.7.5
  4. Cleaning and Reinstalling CocoaPods:

    sudo gem uninstall cocoapodssudo gem install cocoapods -v 1.11.3
  5. Cleaning Pods:

    pod deintegratepod cache clean --allrm Podfile Podfile.lockpod install

Viewing all articles
Browse latest Browse all 1021

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>