iOS开发 - cocoapods安装失败

在安装cocoapods时提示:

YAML safe loading is not available.Please upgrade psych to version that supports safe loading(>=2.0)

查看本机支持的镜像

gem sources -l
如果没有( http://gems.ruby-china.org/),没有的话,先删除其他的;

gem sources --remove 地址
添加 http://gems.ruby-china.org/

gem sources -a http://gems.ruby-china.org/
然后执行

sudo gem install -n /usr/local/bin cocoapods --re
没有问题的话,正常会看到下面的提示,说明安装成功

21 gems installed
初始化cocoapods

pod setup


你可能感兴趣的:(iOS开发)