最近更新了系统Mac os 10.15,cocoapods命令无法使用了直接报错
sh: /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory
去相应目录看了下ruby版本确实没有2.3了,只有2.6。那就简单,直接升级下。
sudo gem update --system
结果报错
ERROR: While executing gem ... (Errno::EROFS)
Read-only file system @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/gem
然后强制安装指定目录
sudo gem update -n /usr/local/bin --system
然后再升级下cocoapods
sudo gem install -n /usr/local/bin cocoapods --pre
搞定