今天把mac升级了一下系统,升级到了10.15.1,结果pod报错
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
在网上找的解决办法:
1、更新gem:
sudo gem update --system
2、查看gem源
gem sources -l
如果显示的不是https://gems.ruby-china.com/,则需要更改源
gem sources -a https://gems.ruby-china.org
- 升级cocoapods:
sudo gem install -n /usr/local/bin cocoapods --pre
- 查看升级后的cocoapods版本:
pod --version
这时候我的终端还是显示报错
Traceback (most recent call last):
5: from /usr/local/bin/pod:23:in<main>' 4: from /usr/local/bin/pod:23:in
load'
3: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:55:in<top (required)>' 2: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:49:in
run'
1: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:130:inverify_minimum_git_version!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:118:in
git_version': Failed to extract git version fromgit --version
("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun\n") (RuntimeError)
需要去git官网重新下载git
https://git-scm.com/download/mac
重新下载安装完成后就可以了。