在开发iOS程序经常会使用到第三方开源的框架,在是使用Cocoapods时,如果遇到pod install 报如下错误:
$ pod install
Generating Pods project
Abort trap: 6
解决办法:
1.首先需要执行如下命令 (注意:一个一个的执行,且每个命令都要执行)
sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-deintegrate
sudo gem uninstall cocoapods-downloader
sudo gem uninstall cocoapods-plugins
sudo gem uninstall cocoapods-search
sudo gem uninstall cocoapods-stats
sudo gem uninstall cocoapods-try
sudo gem uninstall cocoapods-trunk
2.然后在执行 :
sudo gem install cocoapods --pre
3.如果执行 sudo gem install cocoapods --pre 出现以下错误:
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: cocoapods requires molinillo
4.需要:更新 gem 运行一下命令
sudo gem update --system
5.如果出现以下错误:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj
6.执行以下命令:
sudo gem install -n /usr/local/bin cocoapods --pre
结语: 如果能解决你的问题,请帮忙给一个爱心❤️,谢谢!!!!😁😁