flutter配置出错- CocoaPods installed but not initialized

执行flutter doctor出现Warning: CocoaPods installed but not initialized 问题,然后提示我们去执行: sudo gem install cocoapods

安装cocoapods过程失败,发现原因是:
Unable to download data from https://gems.ruby-china.org/ - bad response Not Found 404

解决方法:
一、首先查看一下自己的ruby,看是不是 https://gems.ruby-china.com/
gem sources -l

二、如果不是 https://gems.ruby-china.com/ 的源的话,就添加新源,卸载旧源;
gem sources --add https://gems.ruby-china.com/ --remove https://gems.ruby-china.org/

三、再次查看自己的ruby,看是否替换成功。如果显示是https://gems.ruby-china.com/则说明替换成功。
gem sources -l

四、重新执行。
sudo gem install cocoapods

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。