Xcode8下面 cocoapods升级报错

24 篇文章 0 订阅
15 篇文章 0 订阅


在跟新Xcode8之后CocoaPods 失效


1.问题:

使用: 

bogon:~ zhanglizhi$ vim Podfile

bogon:~ zhanglizhi$ pod install


报错:

Updating local specs repositories

[!] The `master` repo requires CocoaPods 1.0.0 -  (currently using 0.39.0)

Update CocoaPods, or checkout the appropriate tag in the repo.


[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`


2.尝试解决:

(1) 

bogon:~ zhanglizhi$ pod repo update --verbose

报错:

Updating spec repo `master`

  $ /usr/bin/git pull --ff-only

  error: Your local changes to the following files would be overwritten by merge:

  CocoaPods-version.yml

  Please commit your changes or stash them before you merge.

  error: The following untracked working tree files would be overwritten by merge:

  Specs/0/0/0/CAIStatusBar/0.0.1/CAIStatusBar.podspec.json

  Specs/0/0/0/CWNotificationBanner/0.1.0/CWNotificationBanner.podspec.json

  Specs/0/0/0/CWNotificationBanner/0.1.1/CWNotificationBanner.podspec.json

  Specs/0/0/0/CWNotificationBanner/0.1.2/CWNotificationBanner.podspec.json

  Specs/0/0/0/CWNotificationBanner/0.1.3/CWNotificationBanner.podspec.json

  Specs/0/0/0/CWNotificationBanner/0.2.0/CWNotificationBanner.podspec.json

  Specs/0/0/0/CWNotificationBanner/0.2.1/CWNotificationBanner.podspec.json

  Specs/0/0/0/CWNotificationBanner/0.2.2/CWNotificationBanner.podspec.json

  Specs/0/0/0/CancellationToken/0.1.1/CancellationToken.podspec.json

  Specs/0/0/0/CancellationToken/0.2.0/CancellationToken.podspec.json

  Specs/0/0/0/CodeQuickKit/1.0.0/CodeQuickKit.podspec.json

  Specs/0/0/0/CodeQuickKit/1.0.1/CodeQuickKit.podspec.json

  Specs/0/0/0/CodeQuickKit/1.0.2/CodeQuickKit.podspec.json

  Specs/0/0/0/CodeQuickKit/1.1.0/CodeQuickKit.podspec.json

  Specs/0/0/0/CodeQuickKit/1.1.1/CodeQuickKit.podspec.json

  Specs/0/0/0/CodeQuickKit/1.1.2/CodeQuickKit.podspec.json

  Specs/0/0/0/CodeQuickKit/1.1.3/CodeQuickKit.podspec.json

  Specs/0/0/0/CodeQuickKit/1.1.4/CodeQuickKit.podspec.json

  Specs/0/0/0/CodeQuickKit/1.1.5/CodeQuickKit.podspec.json

  Specs/0/0/0/CodeQuickKit/2.0.0/CodeQuickKit.podspec.json

  Specs/0/0/0/CodeQuickKit/2.0.1/CodeQuickKit.podspec.json

........

Please move or remove them before you merge.

  Aborting

  Updating 432723a..b7ab56b

[!] The `master` repo requires CocoaPods 1.0.0 -  (currently using 0.39.0)

Update CocoaPods, or checkout the appropriate tag in the repo.


/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/sources_manager.rb:258:in `check_version_information'

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/sources_manager.rb:224:in `block (2 levels) in update'

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:59:in `section'

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/sources_manager.rb:212:in `block in update'

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/sources_manager.rb:211:in `each'

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/sources_manager.rb:211:in `update'

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/command/repo/update.rb:22:in `run'

/Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:312:in `run'

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/command.rb:47:in `run'

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/bin/pod:44:in `<top (required)>'

/usr/local/bin/pod:23:in `load'

/usr/local/bin/pod:23:in `<main>'


[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`


(2)再次报错后,尝试解决

bogon:~ zhanglizhi$ sudo gem install -n /usr/local/bin cocoapods –pre

报错:

ERROR:  While executing gem ... (Gem::DependencyError)

    Unable to resolve dependencies: cocoapods requires cocoapods-core (= 1.1.1), cocoapods-downloader (< 2.0, >= 1.1.2), cocoapods-trunk (< 2.0, >= 1.1.1), xcodeproj (< 2.0, >= 1.3.3)


(3)再次尝试

bogon:~ zhanglizhi$ gem update cocoapods

报错:

Updating installed gems

Updating cocoapods

Fetching: cocoapods-core-1.0.1.gem (100%)

ERROR:  While executing gem ... (Gem::FilePermissionError)

    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

bogon:~ zhanglizhi$ Fetching: cocoapods-core-1.0.1.gem (100%)

-bash: syntax error near unexpected token `('

bogon:~ zhanglizhi$ ERROR:  While executing gem ... (Gem::FilePermissionError)

-bash: syntax error near unexpected token `('


(4)再次

bogon:~ zhanglizhi$ gem update --system

失败:

Updating rubygems-update

Fetching: rubygems-update-2.6.7.gem (100%)

ERROR:  While executing gem ... (Gem::FilePermissionError)

    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.


3.备注:最后采取删除 卸载Cocoapods

1.在sudo gem install -n /usr/local/bin cocoapods –pre 报错之后
2.使用sudo chmod +rx /usr/local/bin/ 
3.卸载  gem uninstall cocoapods


4.从新安装

(1).查看:  

gem sources -l

显示:

*** CURRENT SOURCES ***


https://ruby.taobao.org/


(2).删除

bogon:~ zhanglizhi$ gem source -r https://ruby.taobao.org/

显示:

https://ruby.taobao.org/ removed from sources

(3).替换

gem source -a http://rubygems.org/ to read

显示:

https://rubygems.org is recommended for security over http://rubygems.org/


Do you want to add this insecure source? [yn]  y

http://rubygems.org/ added to sources


(4).安装

bogon:~ zhanglizhi$  sudo gem install cocoapods



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值