How to Fix Cocoapods Install Errors on an Apple Silicon Macs

Just Another Dang How To Channel · 74K views · 2022 · 7:59

Open on YouTube

Testing, debugging & developer toolsPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when pod install or gem install fails on an M1 or M2 Mac, especially in Flutter and iOS projects hitting Ruby permission errors.

Recommended by 4 people across 3 different months, 2022 to 2024.

What it is

A short screencast tutorial showing how to fix CocoaPods install failures on Apple Silicon Macs. It replaces the outdated system Ruby with a current version using Homebrew, ruby-install and chruby, then installs CocoaPods with gem. It is presented by the Just Another Dang How To Channel.

What people said

Recommends Hudson Moreira da Cunha · 2022-09 · Stack Overflow · on “Pod install error on M1 Mac - Flutter project with native code like shared_preferences”

I followed all these guidelines and nothing worked, after a lot of searching I found this video [this video] that solved this pod install problem once and for all

Recommends baru · 2022-09 · Stack Overflow · on “Cannot run the Flutter project with Firebase in MacBook M1”

These are the notes I did when fixing this issue. Good luck :) Device: MBP 16” M1 Pro 2022 OS: 12.4 Issue - application not running iOS simulator. Gems were installed under old Ruby version that comes preinstalled. I am not sure what exactly fixed the issue but this was I did: Update OS Update XCode Install Ruby 3 Update Gems Update / Install CocoaPods !!Add command line tools to XCode. Links: Why You Should Never Use sudo to Install Ruby Gems: [LINK] !! The fastest and easiest way to install Ruby on a Mac in 2022: [LINK] How to Fix Cocoapods Install Errors on an Apple Silicon Macs: [this video] Update Gems: [LINK] !!Add Command Line Tools to XCode: [LINK] CocoaPods: [LINK]

Recommends Atharv Sharma · 2023-07 · Stack Overflow · on “You don't have write permissions when installing cocoapods on macOS”

From what I found online is that this issue is caused due to Mac OS default installation of Ruby and it is old version. You would have to update it using home-brew step 1: Install Homebrew /bin/bash -c "$(curl -fsSL [LINK] )" step 2: Install Ruby Manager brew install ruby-install chruby step 3: add this to your zsh profile source /usr/local/opt/chruby/share/chruby/chruby.sh and source /usr/local/opt/chruby/share/chruby/auto.sh step 4: save it step 5: write ruby-install --latest ruby to install latest ruby version step 6: restart terminal and check if new version has been installed ruby --version step 7: finally sudo gem install cocoapods if you are unable to follow these instruction then ple

Recommends jestrabikr · 2024-06 · Stack Overflow · on “Error Regarding undefined method `map' for nil:NilClass for Flutter App / CocoaPod Error”

After being stuck with this and trying almost evetrything I solved it with the help of this video: [this video] Only difference was that I had to use ruby-install --update ruby 3.3.3 (your version may differ in the future) instead of ruby-install --latest ruby because --latest flag is deprecated) Then I did pod install in ios folder and it worked. I am using M2 air, MacOS 14.4