Cocoapods: pod lib create fails (cannot load such file -- colored2)

Created on 17 Apr 2017  路  6Comments  路  Source: CocoaPods/CocoaPods

Before you start, are you using the latest CocoaPods release?

pod --version
1.2.0

Xcode
Version 8.3.1 (8E1000a)

Report

What did you do?

pod lib create test-lib

What did you expect to happen?

a new pod was created successfully

What happened instead?

Cloning https://github.com/CocoaPods/pod-template.git into test-lib.
Configuring test-lib template.
/usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:120:in require': cannot load such file -- colored2 (LoadError) from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:120:inrequire'
from /Users/guofengjd/work/github/test-lib/setup/TemplateConfigurator.rb:2:in <top (required)>' from ./configure:5:inrequire_relative'
from ./configure:5:in block in <main>' from ./configure:4:ineach'
from ./configure:4:in `

'

To learn more about the template see https://github.com/CocoaPods/pod-template.git.
To learn more about creating a new pod, see http://guides.cocoapods.org/making/making-a-cocoapod.

CocoaPods Environment

Stack

   CocoaPods : 1.2.0
        Ruby : ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
    RubyGems : 2.6.8
        Host : Mac OS X 10.12.4 (16E195)
       Xcode : 8.3.1 (8E1000a)
         Git : git version 2.11.0 (Apple Git-81)
Ruby lib dir : /usr/local/Cellar/ruby/2.4.0/lib
Repositories : macdownapp - https://github.com/MacDownApp/cocoapods-specs.git @ 10489289aa68862f589277080feb886dd26808cf
               master - https://github.com/CocoaPods/Specs.git @ 2092cb0a77d218e5c9847b89419e2ba52db8b353

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.1.2
cocoapods-try         : 1.1.0

Most helpful comment

Yes, it's OK when CocoaPods updated to 1.2.1

All 6 comments

version 1.2.1 is ok

It looks like If you want to use pod lib create from an older version of CocoaPods, you'll need to run gem install colored2 beforehand.

Yes, it's OK when CocoaPods updated to 1.2.1

Awesome! Glad you were able to get it resolved by upgrading! Since this appears to be fixed now, I'm going to close this. Have a great day!

pod --version 1.1.1 similar error

Here is how I updated and got it to work given the problem described by the OP and the solutions hinted by the comments:

I originally installed cocoapods 1.0.0 some months ago. Recently, I opened CocoaPods.app and was prompted to update to 1.2.0, which I did. After this, I got the subject error by the OP.

I could not get my CocoaPods.app to find an update for 1.2.1 (indicated by commenter that this would fix the issue), but the app says 1.2.0 is the latest update.

I then reinstalled cocoapods using gem install cocoapods command. This must be different from the CocoaPods.app, as CocoaPods.app still appears to be version 1.2.0.

Here is the verbose output of that gem install:

sudo gem install cocoapods
Password:
Sorry, try again.
Password:
Fetching: concurrent-ruby-1.0.5.gem (100%)
Successfully installed concurrent-ruby-1.0.5
Fetching: i18n-0.9.1.gem (100%)
Successfully installed i18n-0.9.1
Fetching: thread_safe-0.3.6.gem (100%)
Successfully installed thread_safe-0.3.6
Fetching: tzinfo-1.2.4.gem (100%)
Successfully installed tzinfo-1.2.4
Fetching: activesupport-4.2.10.gem (100%)
Successfully installed activesupport-4.2.10
Fetching: nap-1.1.0.gem (100%)
Successfully installed nap-1.1.0
Fetching: fuzzy_match-2.0.4.gem (100%)
Successfully installed fuzzy_match-2.0.4
Fetching: cocoapods-core-1.3.1.gem (100%)
Successfully installed cocoapods-core-1.3.1
Fetching: claide-1.0.2.gem (100%)
Successfully installed claide-1.0.2
Fetching: cocoapods-deintegrate-1.0.1.gem (100%)
Successfully installed cocoapods-deintegrate-1.0.1
Fetching: cocoapods-downloader-1.1.3.gem (100%)
Successfully installed cocoapods-downloader-1.1.3
Fetching: cocoapods-plugins-1.0.0.gem (100%)
Successfully installed cocoapods-plugins-1.0.0
Fetching: cocoapods-search-1.0.0.gem (100%)
Successfully installed cocoapods-search-1.0.0
Fetching: cocoapods-stats-1.0.0.gem (100%)
Successfully installed cocoapods-stats-1.0.0
Fetching: netrc-0.11.0.gem (100%)
Successfully installed netrc-0.11.0
Fetching: cocoapods-trunk-1.3.0.gem (100%)
Successfully installed cocoapods-trunk-1.3.0
Fetching: cocoapods-try-1.1.0.gem (100%)
Successfully installed cocoapods-try-1.1.0
Fetching: molinillo-0.5.7.gem (100%)
Successfully installed molinillo-0.5.7
Fetching: CFPropertyList-2.3.6.gem (100%)
Successfully installed CFPropertyList-2.3.6
Fetching: colored2-3.1.2.gem (100%)
Successfully installed colored2-3.1.2
Fetching: nanaimo-0.2.3.gem (100%)
Successfully installed nanaimo-0.2.3
Fetching: xcodeproj-1.5.4.gem (100%)
Successfully installed xcodeproj-1.5.4
Fetching: escape-0.0.4.gem (100%)
Successfully installed escape-0.0.4
Fetching: fourflusher-2.0.1.gem (100%)
Successfully installed fourflusher-2.0.1
Fetching: gh_inspector-1.0.3.gem (100%)
Successfully installed gh_inspector-1.0.3
Fetching: ruby-macho-1.1.0.gem (100%)
Successfully installed ruby-macho-1.1.0
Fetching: cocoapods-1.3.1.gem (100%)
cocoapods's executable "pod" conflicts with /usr/local/bin/pod
Overwrite the executable? [yN]  y
Successfully installed cocoapods-1.3.1
Parsing documentation for concurrent-ruby-1.0.5
Installing ri documentation for concurrent-ruby-1.0.5
Parsing documentation for i18n-0.9.1
Installing ri documentation for i18n-0.9.1
Parsing documentation for thread_safe-0.3.6
Installing ri documentation for thread_safe-0.3.6
Parsing documentation for tzinfo-1.2.4
Installing ri documentation for tzinfo-1.2.4
Parsing documentation for activesupport-4.2.10
Installing ri documentation for activesupport-4.2.10
Parsing documentation for nap-1.1.0
Installing ri documentation for nap-1.1.0
Parsing documentation for fuzzy_match-2.0.4
Installing ri documentation for fuzzy_match-2.0.4
Parsing documentation for cocoapods-core-1.3.1
Installing ri documentation for cocoapods-core-1.3.1
Parsing documentation for claide-1.0.2
Installing ri documentation for claide-1.0.2
Parsing documentation for cocoapods-deintegrate-1.0.1
Installing ri documentation for cocoapods-deintegrate-1.0.1
Parsing documentation for cocoapods-downloader-1.1.3
Installing ri documentation for cocoapods-downloader-1.1.3
Parsing documentation for cocoapods-plugins-1.0.0
Installing ri documentation for cocoapods-plugins-1.0.0
Parsing documentation for cocoapods-search-1.0.0
Installing ri documentation for cocoapods-search-1.0.0
Parsing documentation for cocoapods-stats-1.0.0
Installing ri documentation for cocoapods-stats-1.0.0
Parsing documentation for netrc-0.11.0
Installing ri documentation for netrc-0.11.0
Parsing documentation for cocoapods-trunk-1.3.0
Installing ri documentation for cocoapods-trunk-1.3.0
Parsing documentation for cocoapods-try-1.1.0
Installing ri documentation for cocoapods-try-1.1.0
Parsing documentation for molinillo-0.5.7
Installing ri documentation for molinillo-0.5.7
Parsing documentation for CFPropertyList-2.3.6
Installing ri documentation for CFPropertyList-2.3.6
Parsing documentation for colored2-3.1.2
Installing ri documentation for colored2-3.1.2
Parsing documentation for nanaimo-0.2.3
Installing ri documentation for nanaimo-0.2.3
Parsing documentation for xcodeproj-1.5.4
Installing ri documentation for xcodeproj-1.5.4
Parsing documentation for escape-0.0.4
Installing ri documentation for escape-0.0.4
Parsing documentation for fourflusher-2.0.1
Installing ri documentation for fourflusher-2.0.1
Parsing documentation for gh_inspector-1.0.3
Installing ri documentation for gh_inspector-1.0.3
Parsing documentation for ruby-macho-1.1.0
Installing ri documentation for ruby-macho-1.1.0
Parsing documentation for cocoapods-1.3.1
Installing ri documentation for cocoapods-1.3.1
Done installing documentation for concurrent-ruby, i18n, thread_safe, tzinfo, activesupport, nap, fuzzy_match, cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, cocoapods-plugins, cocoapods-search, cocoapods-stats, netrc, cocoapods-trunk, cocoapods-try, molinillo, CFPropertyList, colored2, nanaimo, xcodeproj, escape, fourflusher, gh_inspector, ruby-macho, cocoapods after 88 seconds
27 gems installed

After reinstalling as indicated above, I ran pod lib create MyFramework and this appeared to work as desired in "What did you expect to happen?"

Was this page helpful?
0 / 5 - 0 ratings