skip to Main Content

A couple of days ago I upgrade my Mac to MacOS 15 Sequoia. But today when I try to install pod in one project I got an error related to cocoaPods and ruby

$ npx pod-install ios
Scanning for pods...
/opt/homebrew/bin/pod: /opt/homebrew/Cellar/cocoapods/1.15.2_1/libexec/bin/pod: /opt/homebrew/opt/ruby/bin/ruby: bad interpreter: No such file or directory
/opt/homebrew/bin/pod: line 2: /opt/homebrew/Cellar/cocoapods/1.15.2_1/libexec/bin/pod: Undefined error: 0
› Attempting to install CocoaPods CLI with Gem
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
Your password might be needed to install CocoaPods CLI: https://guides.cocoapods.org/using/getting-started.html#installation
Password:
ERROR:  Error installing cocoapods:
    The last version of drb (>= 0) to support your Ruby & RubyGems was 2.0.6. Try installing it with `gem install drb -v 2.0.6` and then running the current command again
    drb requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.
› Failed to install CocoaPods CLI with Gem

I have another project that works fine and I tried to remove the pod and reinstall. This project started to fail as well.

I check the react-native doctor command and I got this:

Common
 ✓ Node.js
 ✓ yarn
 ✓ Watchman - Used for watching changes in the filesystem when in development mode

Android
 ✓ JDK
 ✓ Android Studio - Required for building and installing your app on Android
 ✓ Android SDK - Required for building and installing your app on Android
 ✓ ANDROID_HOME

iOS
 ✓ Xcode - Required for building and installing your app on iOS
 ✖ CocoaPods - Required for installing iOS dependencies
   - Version found: N/A
   - Version supported: >= 1.10.0
 ✓ ios-deploy - Required for installing your app on a physical device with the CLI
 ✓ .xcode.env - File to customize Xcode environment

Try to fix the problem with it, but currently doesn’t work. The problem persist.

Here my system information

System:
    OS: macOS 15.0
    CPU: (8) arm64 Apple M1
    Memory: 131.61 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.8.0 - /opt/homebrew/bin/node
    Yarn: 1.22.21 - /opt/homebrew/bin/yarn
    npm: 10.8.2 - /opt/homebrew/bin/npm
    Watchman: 2024.09.02.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: Not Found
  SDKs:
    iOS SDK:
      Platforms: DriverKit 24.0, iOS 18.0, macOS 15.0, tvOS 18.0, visionOS 2.0, watchOS 11.0
    Android SDK:
      API Levels: 33, 34
      Build Tools: 30.0.3, 33.0.0, 33.0.1, 34.0.0
      System Images: android-33 | Google APIs ARM 64 v8a, android-34 | Google APIs ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2023.1 AI-231.9392.1.2311.11076708
    Xcode: 16.0/16A242d - /usr/bin/xcodebuild
  Languages:
    Java: 17.0.12 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: 0.71.1 => 0.71.1
    react-native-macos: Not Found

To finish this is what I got when tried to install cocoapods manually.

CocoaPods (installing with gem)(node:10050) [DEP0053] DeprecationWarning: The `util.isObject` API is deprecated. Please use `arg !== null && typeof arg === "object"` instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:10050) [DEP0049] DeprecationWarning: The `util.isFunction` API is deprecated.  Please use `typeof arg === "function"` instead.
 ✖ CocoaPods (installing with gem)

2

Answers


  1. Chosen as BEST ANSWER

    I tried a lot of things, but just removing cocoapods from brew works for me.

    brew uninstall cocoapods
    
    

  2. The error gives us a clue as to what it might be:

    ERROR: Error installing cocoapods:
    The last version of drb (>= 0) supported by your Ruby & RubyGems was 2.0.6. Try installing it with gem install drb -v 2.0.6 and then
    run the current command again
    drb requires a Ruby version >= 2.7.0. The current version of ruby is 2.6.10.210.

    Try running the command it tells you right there, it turns out there is an incompatibility with the drb that Ruby supports:

    Try command: gem install drb -v 2.0.6

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search