mac 10.15 cocoapods无法使用的解决办法

syntax error: unexpected end of file

解决办法

//我开了科学上网
sudo gem install cocoapods

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

ERROR: While executing gem … (TypeError) no implicit conversion of nil into String

这是在执行install cocoapods时报的错误

ERROR:  While executing gem ... (TypeError)
    no implicit conversion of nil into String

解决办法

先执行命令:

sudo gem update -n /usr/local/bin --system

再执行:

udo gem install -n /usr/local/bin cocoapods --pre

参考资料

https://github.com/CocoaPods/CocoaPods/issues/6778

https://stackoverflow.com/questions/44396215/cocoapods-not-working-in-macos-high-sierra