升级10.13系统后,cocospods报错

升级mac os 10.13后,运行cocospods命令会报错:bad interpreter: No such file or directory,

bogon:location_workspace ss$ pod
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory

解决办法:
升级ruby和cocospods
1.sudo gem update --system
2.sudo gem install cocoapods
但是很坑,第一个命令也可能报错

ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://ruby.taobao.org/specs.4.8.gz)

这是因为taobao Gems 源已停止维护,现由 ruby-china 提供镜像服务,需要更换成ruby-china的源
首先删除taobao 源
终端输入 gem sources --remove https://ruby.taobao.org/
成功后,在指定新源 gem sources -a https://gems.ruby-china.org/
然后输入gem sources -l命令查看源是否确实安装成功

图片.png

接着输入上述命令,就可以正常安装完成

你可能感兴趣的:(升级10.13系统后,cocospods报错)