这个项目的一个版本我遇到了一些问题。我发现了这个answer,有人建议从机器上删除所有cocoapods连接的东西并重新安装它。我确实遵循了步骤:
$ 'pod --version'
0.36.1
$ gem list --local | grep cocoapods
cocoapods (0.39.0.rc.1, 0.38.2, 0.38.1, 0.37.2)
cocoapods-core (0.39.0.rc.1, 0.38.2, 0.38.1, 0.37.2)
cocoapods-downloader (0.9.3, 0.9.1)
cocoapods-plugins (0.4.2)
cocoapods-search (0.1.0)
cocoapods-stats (0.6.2, 0.5.3)
cocoapods-trunk (0.6.4, 0.6.1)
cocoapods-try (0.5.1, 0.4.5)
$ gem uninstall cocoapods // and all others from the list above问题是,当我再次用grep所有cocoapods,列表等于上一个,什么都没有消失。
$ sudo gem uninstall cocoapods
Select gem to uninstall:
1. cocoapods-0.37.2
2. cocoapods-0.38.1
3. cocoapods-0.38.2
4. cocoapods-0.39.0.rc.1
5. All versions
> 5
$ pod --version
// here was the error command not found, so everything fine
$ sudo gem install cocoapods
Fetching: cocoapods-0.38.2.gem (100%)
Successfully installed cocoapods-0.38.2
Parsing documentation for cocoapods-0.38.2
Installing ri documentation for cocoapods-0.38.2
Done installing documentation for cocoapods after 2 seconds
1 gem installed
$ pod --version
Could not find proper version of cocoapods (0.36.1) in any of the sources
Run `bundle install` to install missing gems.但它为什么要我安装0.36.1呢?不管怎么说,就像它说的,我做了:
$bundle install
Installing cocoapods-core 0.36.1
Installing cocoapods-downloader 0.8.1
Installing cocoapods-plugins 0.4.1
Installing cocoapods-trunk 0.6.0
Installing cocoapods-try 0.4.3
Installing cocoapods 0.36.1
// Many "using" dependencies所以当我跑的时候:
$ pod --version
0.36.1我被困住了:)为什么我不能有最新的版本?也许pod --version指的是cocoapods-core的最新版本,而不是cocoapods,所以一切都还好,我有正确的版本吗?
发布于 2015-10-06 12:31:13
我的红宝石版好像有什么东西搞砸了。我还是不知道是什么原因。我已经设法通过以下解决方案:https://stackoverflow.com/a/25021772/849616修复了它。之后一切都正常了。
发布于 2018-03-26 12:19:03
pod *version* action使用特定的版本。例如:pod _1.5.0.beta.1_ update或pod _1.5.0.beta.1_ install发布于 2018-12-20 20:49:08
任何想要更新cocoapods的人。在做了以上所有的工作之后,我没能解决这个问题。然后,我转向已解决的答案,并且不愿意删除RVM,我试图以另一种方式解决这个问题。
我发现我的问题确实存在于我的个人档案中。
首先,运行gem install cocoapods,以确保您有最新版本,或任何您要下载的指定版本。
其次,确保您的项目Gemfile没有指定cocoapods版本号,而只是将其指定为:gem "cocoapods" (如果您没有指定),更改它并运行bundle update来重新生成Gemfile.lock文件,您的问题就会得到解决。如果没有,继续删除Gemfile.lock文件,然后运行bundle update。通过打开Gemfile.lock文件并搜索cocoapods-core <version number here>,您可以轻松地检查将加载哪个宝石版本。
此时,您可以进入您的项目并运行pod setup,然后使用pod --version检查cocoapods版本
现在,您终于可以自由地运行pod install来替换Podfile.lock文件,回到您快乐的开发生活了。希望这能帮助别人,让他们从燃烧的时间中解脱出来。
https://stackoverflow.com/questions/32965735
复制相似问题