安装pod(cocoapods)时出错

时间:2016-11-27 16:24:35

标签: cocoapods

我在项目中使用可可豆荚时遇到了麻烦,所以我决定卸载并重新安装。现在它破了。我完全从我的系统中删除了所有可可豆荚并重新安装。 (包括删除可可豆荚目录)

gem install cocoapods
pod setup

似乎有效

Setting up CocoaPods master repo

CocoaPods 1.2.0.beta.1 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

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

Setup completed

现在我安装了pod后:

pod install --verbose
  Preparing
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

Setting up CocoaPods master repo
  $ /usr/local/bin/git remote set-url origin
  https://github.com/CocoaPods/Specs.git
  $ /usr/local/bin/git checkout master
  Already on 'master'
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master-1`.
(The `master` repo is not a git repo.)
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

/Users/Nic/.rvm/gems/ruby-2.2.3/gems/cocoapods-1.1.1/lib/cocoapods/sources_manager.rb:35:in `rescue in find_or_create_source_with_url'
/Users/Nic/.rvm/gems/ruby-2.2.3/gems/cocoapods-1.1.1/lib/cocoapods/sources_manager.rb:38:in `find_or_create_source_with_url'
/Users/Nic/.rvm/gems/ruby-2.2.3/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:814:in `block in sources'
/Users/Nic/.rvm/gems/ruby-2.2.3/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:813:in `map'
/Users/Nic/.rvm/gems/ruby-2.2.3/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:813:in `sources'
/Users/Nic/.rvm/gems/ruby-2.2.3/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:143:in `resolve_dependencies'
/Users/Nic/.rvm/gems/ruby-2.2.3/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:110:in `install!'
/Users/Nic/.rvm/gems/ruby-2.2.3/gems/cocoapods-1.1.1/lib/cocoapods/command/install.rb:37:in `run'
/Users/Nic/.rvm/gems/ruby-2.2.3/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/Users/Nic/.rvm/gems/ruby-2.2.3/gems/cocoapods-1.1.1/lib/cocoapods/command.rb:50:in `run'
/Users/Nic/.rvm/gems/ruby-2.2.3/gems/cocoapods-1.1.1/bin/pod:55:in `<top (required)>'
/Users/Nic/.rvm/gems/ruby-2.2.3/bin/pod:23:in `load'
/Users/Nic/.rvm/gems/ruby-2.2.3/bin/pod:23:in `<main>'
/Users/Nic/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
/Users/Nic/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'

我实际上在卸载之前可可豆荚工作正常,但现在每次都会发生这种情况! 我的pod文件:

target 'Project' do

  pod 'RestKit', '~> 0.24.0'

end

1 个答案:

答案 0 :(得分:1)

通过更新git修复。如果没有正确更新,还必须将它与brew链接