While executing gem ... (Gem::FilePermissionError)

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

运行都失败

While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0
directory.

请使用 brew 安装

brew cocoapods 安装流程

你可能感兴趣的:(ruby,cocoapods)