ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for

在cocoapods 执行
gem install cocoapods 命令时出现
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
此时执行:sudo gem install cocoapods 会提示输入电脑密码。
上面命令执行报错: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /usr/bin directory.
则需改为执行:sudo gem install -n /usr/local/bin cocoapods

你可能感兴趣的:(ios,objective-c,xcode)