DEV Community


sudo gem install cocoapods failed

idawnwon profile image idawnwon ・1 min read


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


  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/
Enter fullscreen mode Exit fullscreen mode


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

Discussion (0)

Editor guide