The version of CocoaPods used to generate the lockfile (1.5.3) is higher than the version of the ...

  • 目录
  • 报错
  • 方法1
  • 方法2
  • 致谢

今天执行pod install时候报错
The version of CocoaPods used to generate the lockfile (1.5.3) is higher than the version of the current executable (1.5.0). Incompatibility issues may arise.

网上搜了下

1. 方法1

执行pod repo update,但是执行后尝试pod install依然报错,于是继续 方法2

ff-2:ff fengfeng$ pod repo update
Updating spec repo `master`
  $ /usr/bin/git -C /Users/fengfeng/.cocoapods/repos/master fetch origin --progress
  remote: Enumerating objects: 148407, done.        
  remote: Counting objects: 100% (148407/148407), done.        
  remote: Compressing objects: 100% (197/197), done.        
  remote: Total 687153 (delta 148256), reused 148293 (delta 148200), pack-reused 538746        
  Receiving objects: 100% (687153/687153), 78.64 MiB | 23.00 KiB/s, done.
  Resolving deltas: 100% (466772/466772), completed with 10672 local objects.
  From https://github.com/CocoaPods/Specs
     afd3d4842ce..86f53a84f68  master     -> origin/master
  $ /usr/bin/git -C /Users/fengfeng/.cocoapods/repos/master rev-parse --abbrev-ref HEAD
  master
  $ /usr/bin/git -C /Users/fengfeng/.cocoapods/repos/master reset --hard origin/master
  Checking out files: 100% (305141/305141), done.
  HEAD is now at 86f53a84f68 [Add] FPHDataModel 0.0.2
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 68675 and retry the command.

CocoaPods 1.6.0 is available.
To update use: `sudo gem install cocoapods`

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.6.0

2. 方法2

升级sudo gem install cocoapods时候报错

ff-2:ff fengfeng$ sudo gem install cocoapods
Password:
ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why:
          Unable to download data from https://gems.ruby-china.org/ - bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)
ff-2:ff fengfeng$ 

因为ruby的软件源 https://gems.ruby-china.org/ 无效了
需要更新一下ruby的源为 https://gems.ruby-china.com/

  • https://gems.ruby-china.org/
$ gem sources -l #查看当前ruby的源
$ gem sources --remove https://gems.ruby-china.org/
$ gem sources -a https://gems.ruby-china.com/
$ gem sources -l

请尽可能用比较新的 RubyGems 版本,建议 2.6.x 以上

$ gem update --system # 这里请翻墙一下
$ gem -v

升级成功后会提示: RubyGems system software updated

然后重新安装CocoaPods
macOS 10.11前:$ sudo gem install cocoapods
macOS 10.11后:$ sudo gem install -n /usr/local/bin cocoapods

最终成功执行 pod install


不定期更新 不合适的地方 还请指点~ 感激不尽

你可能感兴趣的:(The version of CocoaPods used to generate the lockfile (1.5.3) is higher than the version of the ...)