Upgrade Cocoapods 1.0.0 Problem Resolution Rollup

Source: Internet
Author: User
Tags install cocoapods

Last night upgraded CocosPads1.0, just installed successfully, now the project inside the pod install found a few problems, yesterday toss too late. Let's go on with the toss today.
Today I finally got the CocosPods1.0, including installation, running and an open source project Podfile 1.0 upgrades.
<!--more-->
When you run pod install, you find that there are 1.0 versions of Cocoapods, so you plan to upgrade.
Cocoapods 1.0.0 is available.
To update Use:gem install Cocoapods

The result is the following error, analyzed the reason is the/usr/bin/xcodeproj directory path is wrong, online search to solve the problem, using the sudo gem install-n/usr/local/bin cocoapods--pre Command successful installation successfully.

$ sudo gem install cocoapods
ERROR: While  executing gem ... (errno::eperm)
    Operation not permitted-/usr/bin/xcodeproj

$ ls-al/usr/bin/xcodeproj
ls:cannot Access/usr/bin/xcodeproj:no Such file or directory
$ sudo gem install-n/usr/local/bin cocoapods--pre successfully
. 0
Fetching:molinillo-0.4.5.gem (100%)
successfully installed molinillo-0.4.5
fetching: Cocoapods-try-1.0.0.gem (100%)
successfully installed cocoapods-try-1.0.0

Running the pod install under the project has an error:

Od install/library/ruby/gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/sources_manager.rb:159:in ' <module: Sourcesmanagermissingconstant> ': Uninitialized constant Pod::sourcesmanagermissingconstant::set (NameError) from /library/ruby/gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/sources_manager.rb:158:in ' <module:Pod> ' from/ Library/ruby/gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/sources_manager.rb:3:in ' <top (required) > ' From/ Library/ruby/site/2.0.0/rubygems/core_ext/kernel_require.rb:69:in ' Require ' from/library/ruby/site/2.0.0/ Rubygems/core_ext/kernel_require.rb:69:in ' Require ' from/library/ruby/gems/2.0.0/gems/cocoapods-1.0.0/lib/ Cocoapods/core_overrides.rb:1:in ' <top (required) > ' From/library/ruby/site/2.0.0/rubygems/core_ext/kernel_ Require.rb:69:in ' require ' from/library/ruby/site/2.0.0/rubygems/core_ext/kernel_require.rb:69:in ' require ' from /library/ruby/gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods.rb:71:in ' <moDule:pod> ' From/library/ruby/gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods.rb:17:in ' <top (required) > ' F Rom/library/ruby/site/2.0.0/rubygems/core_ext/kernel_require.rb:69:in ' Require ' from/library/ruby/site/2.0.0/ Rubygems/core_ext/kernel_require.rb:69:in ' Require ' from/library/ruby/gems/2.0.0/gems/cocoapods-1.0.0/bin/pod:36 : In ' <top (required) > ' from/usr/local/bin/pod:23:in ' Load ' from/usr/local/bin/pod:23:in ' <main> '

Search on the Internet, found that this issue has been close, but it seems that there is no update ah, https://github.com/CocoaPods/CocoaPods/pull/5288
I had to look at the code to modify it:
Modify/LIBRARY/RUBY/GEMS/2.0.0/GEMS/COCOAPODS-1.0.0/LIB/COCOAPODS/SOURCES_MANAGER.RB
Increase in the second line

Require ' Set '

To save the file, you need to enter a password.

Continue to run Pod install and report the following error:

Edhita $ pod Install
re-creating cocoapods due to major version update.
[!] ': Head ' dependencies have been removed. Please use the normal external source dependencies (': Git => ' git_repo_url ') instead of ': Head ' for ' Edhfontselector '.

This should be a version compatibility issue, or take a closer look at the official release instructions for Cocoapods 1.0.
It should be unsupported: head this syntax, and must have target.

Here's an official migration guide.
Hug Cocoapods 1.0

Here's an example of an upgrade using the podfile of the markdown editor you're researching, Edhita.
Original Address Https://github.com/tnantoka/edhita/blob/master/Podfile
Code before migration:

Platform:ios, "8.0"

source ' https://github.com/CocoaPods/Specs.git '

pod ' edhfinder ', ' ~> 0.1 '
pod ' Edhfontselector ',: Head
pod ' Edhinputaccessoryview ', ' ~> 0.1 '
pod ' google-mobile-ads-sdk '
pod ' Colours ', ' ~> 5.5 '
pod ' fxforms ', ' ~> 1.2 '
pod ' ghmarkdownparser ', ' ~> 0.1 '
pod ' Vtacknowledgementsviewcontroller ', ' ~> 0.12 '

pod ' Bootstrap ', Podspec: ' https://raw.githubusercontent.com/ Tnantoka/podspecs/master/specs/bootstrap/bootstrap.podspec '
pod ' Megrim ', Podspec: ' https:// Raw.githubusercontent.com/tnantoka/podspecs/master/specs/megrim/megrim.podspec '
pod ' github-markdown-css ', Podspec: ' https://raw.githubusercontent.com/tnantoka/podspecs/master/Specs/github-markdown-css/ Github-markdown-css.podspec '

post_install do |installer|
  Require ' fileutils '
  fileutils.cp_r (' Pods/target Support files/pods/pods-acknowledgements.plist ', ' edhita/ Assets/pods-acknowledgements.plist ') End

Code after upgrading to Cocospods 1.0

 Platform:ios, "8.0" source ' https://github.com/CocoaPods/Specs.git ' target ' edhita ' pod ' edhfinder ', ' ~> 0.1 ' PO d ' edhfontselector ', ' ~> 0.1 ' pod ' edhinputaccessoryview ', ' ~> 0.1 ' pod ' google-mobile-ads-sdk ' pod ' Colours ', ' ~> ;

5.5 ' pod ' fxforms ', ' ~> 1.2 ' pod ' ghmarkdownparser ', ' ~> 0.1 ' pod ' vtacknowledgementsviewcontroller ', ' ~> 0.12 ' # pod ' Bootstrap ', Podspec: ' https://raw.githubusercontent.com/tnantoka/podspecs/master/Specs/Bootstrap/ Bootstrap.podspec ' # pod ' Megrim ', Podspec: ' https://raw.githubusercontent.com/tnantoka/podspecs/master/Specs/ Megrim/megrim.podspec ' # pod ' github-markdown-css ', Podspec: ' https://raw.githubusercontent.com/tnantoka/podspecs/
  Master/specs/github-markdown-css/github-markdown-css.podspec ' Post_install do |installer| Require ' fileutils ' # fileutils.cp_r (' Pods/target Support files/pods-edhita/pods-edhita-acknowledgements.plist ', ' Edhita/assets/pods-acknowledgements.plist ') End 

I'm lazy. Annotate some unwanted code, run pod install, Xcode open Edhita.xcworkspace, you can compile it. The effect is as follows
Edhiha

This Cocoapods 1.0 upgrade experience is really a pit ah, after 4.5 of the development of the release of the 1.0 version ah, do not know what to say good.
Cherish life, new project Embrace Carthage Bar. But also not to use cocoapods ah, so many open source projects are used Ah, or temporarily do not upgrade 1.0.

Wen/offbye (author of Jane book)
Original link: HTTP://WWW.JIANSHU.COM/P/A45B8B708ECB
Copyright belongs to the author, reproduced please contact the author to obtain authorization, and labeled "Jane book author."

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.