updating......
- pod install
问题1:[!] Unable to find a specification for 'xxx'(找不到第三方框架)
-
pod repo update
更新一下repo,更新完成之后即可解决
问题2:Specs satisfying the ' XXXPods/Masonry (~> 1.0.15) ' dependency were found, but they required a higher minimum deployment target.
- 检查PodFile文件里platform系统版本号,一般是因为版本低于依赖第三方库所支持的最低系统版本
- 例如 platform :ios, '9.0'
- pod setup
问题1:[!] Unable to add a source with url 'https://github.com/CocoaPods/Specs.git' named 'master'. You can try adding it manually in '~/.cocoapods/repos' or via 'pod repo add'.
问题2:error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
- 网络问题,最直接的办法.....连热点操作.....
- 也可以进入.cocoapods/repos/目录下直接克隆(也依赖网络)
git clone https://github.com/CocoaPods/Specs.git
查看本地仓库
- cd ~/.cocoapods
- cd repos/
- cd ls
问题:升级ruby后:find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException)
- ruby路径问题,需要重新安装cocoapods
-
sudo gem uninstall cocoapods
-gem install cocoapods
pod install
- 紧接着可能出现以下问题
问题:
CocoaPods : 1.3.1
Ruby : ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-darwin16]
RubyGems : 2.7.7
Host : Mac OS X 10.12.6 (16G29)
Xcode : ()
Git : git version 2.14.3 (Apple Git-98)
Ruby lib dir : /Users/liqi/.rvm/rubies/ruby-2.4.4/lib
### Error
ArgumentError - Malformed version number string
/Users/liqi/.rvm/rubies/ruby-2.4.4/lib/ruby/site_ruby/2.4.0/rubygems/version.rb:209:in `initialize'
/Users/liqi/.rvm/rubies/ruby-2.4.4/lib/ruby/site_ruby/2.4.0/rubygems/version.rb:200:in `new'
/Users/liqi/.rvm/rubies/ruby-2.4.4/lib/ruby/site_ruby/2.4.0/rubygems/version.rb:200:in `new'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:119:in `embedded_content_settings'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:64:in `generate'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:39:in `save_as'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb:109:in `update_changed_file'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:87:in `block in create_xcconfig_file'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:84:in `each'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:84:in `create_xcconfig_file'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:18:in `block in install!'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/user_interface.rb:142:in `message'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:14:in `install!'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/pods_project_generator.rb:173:in `block (2 levels) in install_libraries'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/pods_project_generator.rb:171:in `each'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/pods_project_generator.rb:171:in `block in install_libraries'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/user_interface.rb:142:in `message'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/pods_project_generator.rb:165:in `install_libraries'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/pods_project_generator.rb:65:in `generate!'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:183:in `block in generate_pods_project'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:182:in `generate_pods_project'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:119:in `install!'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/command/install.rb:41:in `run'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/lib/cocoapods/command.rb:52:in `run'
/Users/liqi/.rvm/gems/ruby-2.4.4/gems/cocoapods-1.3.1/bin/pod:55:in `<top (required)>'
/Users/liqi/.rvm/gems/ruby-2.4.4/bin/pod:23:in `load'
/Users/liqi/.rvm/gems/ruby-2.4.4/bin/pod:23:in `<main>'
/Users/liqi/.rvm/gems/ruby-2.4.4/bin/ruby_executable_hooks:15:in `eval'
/Users/liqi/.rvm/gems/ruby-2.4.4/bin/ruby_executable_hooks:15:in `<main>'
cocoapods对应版本依赖,可以查看: https://rubygems.org/gems/cocoapods/versions/1.3.1
相关问题讨论见:https://github.com/CocoaPods/CocoaPods/issues/7765
#导致的原因主要是:
gem 2.7.7 can not run cocoapods 1.3.x . 1.4.x
you should install rubygem in 2.7.6-意思是要把rubygems回退到2.7.6
gem install rubygems-update -v 2.7.6
update_rubygems
问题:如果上一步回退rubygems遇到问题:
ERROR: Could not find a valid gem 'rubygems-update' (= 2.7.6) in any repository
ERROR: Possible alternatives: rubygems-update
就是国内网络的问题
查看安装源gem sources -l
如果安装源之前设置过阿里云(http://rubygems-china.oss.aliyuncs.com)或者其他,镜像没有更新新的版本,就会报错找不到对应版本信息。
可尝试直接添加一个安装源:https://rubygems.org/
gem sources -a https://rubygems.org/
然后 :) 连着手机热点跑命令gem install ruby gems-update -v 2.7.6
和update_rubygems
当看到以下信息时,说明成功了
bogon:shell liqi$ gem install rubygems-update -v 2.7.6
Fetching: rubygems-update-2.7.6.gem (100%)
Successfully installed rubygems-update-2.7.6
Parsing documentation for rubygems-update-2.7.6
Installing ri documentation for rubygems-update-2.7.6
Done installing documentation for rubygems-update after 44 seconds
1 gem installed
bogon:shell liqi$ update_rubygems
Bundler 1.16.1 installed
RubyGems 2.7.6 installed
Regenerating binstubs
Parsing documentation for rubygems-2.7.6
Installing ri documentation for rubygems-2.7.6
------------------------------------------------------------------------------
RubyGems installed the following executables:
/Users/liqi/.rvm/rubies/ruby-2.4.4/bin/gem
/Users/liqi/.rvm/rubies/ruby-2.4.4/bin/bundle
Ruby Interactive (ri) documentation was installed. ri is kind of like man
pages for Ruby libraries. You may access it like this:
ri Classname
ri Classname.class_method
ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.
回退成功后,再执行命令:pod install
,不出意外应该可以成功了。