当安装 cocoapods 时出现错误?

when install cocoapods get Error?

我尝试 gem 安装 cocoapods 我收到错误消息:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

这是什么意思???

您需要成为 root 才能写入 /Library,因此您需要使用 sudo,因为 the instructions 告诉您:

$ sudo gem install cocoapods