To fix this issue, try running the following command on Mac

$ brew reinstall cocoapods