1.在终端运行:

$ sudo gem install cocoa pods
会出现以下错误:

ERROR:  While executing gem ... (Errno::EPERM)

Operation not permitted - /usr/bin/xcodeproj

2.解决方法:

将其改成等待几秒即可:

$ sudo gem install -n /usr/local/bin cocoapods

05-25 07:57