DEV Community

idawnwon
idawnwon

Posted on

1

sudo gem install cocoapods failed

Environment:

macOS: 10.15.7
Xcode: 12.2, Build version 12B45b
Android Studio: 4.1.1

Process:

  1. Test drive the demo flutter application, run on iOS simulator, everything goes well.
  2. Added some dependencies in pub file, Android Studio throw errors and suggest me to sudo gem install cocoapods.
  3. Tried this command, failed, error log saids, Failed to build gem native extension...
  4. According to MahmoudKhaled's answer, tried these commands, error occurred, Error running 'requirements_osx_brew_libs_install autoconf automake libtool pkg-config coreutils libyaml libksba readline zlib openssl@1.1'
  5. According to joki's answer, tried these commands:
sudo xcode-select --switch /Library/Developer/CommandLineTools
ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'
sudo xcode-select --switch /Applications/Xcode.app
Enter fullscreen mode Exit fullscreen mode

Suggestion:

I strongly recommend you to read joki's answer. Inspired me a lot!

Sentry blog image

The countdown to March 31 is on.

Make the switch from app center suck less with Sentry.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs