Suddenly getting "Failed to install CocoaPods CLI"

  1. SDK Version: 46
  2. Platforms(Android/iOS/web/all): ios

Today I went to build my expo project like normal (npx expo run:ios -d) and suddenly I’m getting

Failed to install CocoaPods CLI with gem (recommended)
└─ Cause: gem exited with non-zero code: 1

This has never happened before, I did literally nothing since the last time I build the project, and I can’t resolve it. Did something change? What do I need to do?

I solved it—first I had to do

sudo xcode-select -switch /Library/Developer/CommandLineTools

Then open Xcode, go to Preferences > Locations and select XCode under “Command Line Tools”

1 Like