SolvedCocoaPods pod lib create fails: uninitialized constant Nanaimo::Reader::StringScanner (NameError)

Before you start, are you using the CocoaPods beta release? No
a lot has changed with Xcode 8 that is not backwards compatible.

Xcode 8 Status: Only works with CocoaPods 1.1.0
Swift 3: You need to add a .swift-version file, see the CHANGELOG
China: Use instead of for the RC see #5910


What did you do?

Ran pod lib create <name>

What did you expect to happen?

Create an initial pod library

What happened instead?

Sort of creates it, but doesn't fill in the name or any info I provided

➜  pod lib create test-lib
Cloning `` into `test-lib`.
Configuring test-lib template.


To get you started we need to ask a few questions, this should only take a minute.

If this is your first time we recommend running through with the guide:
 ( hold cmd and click links to open in a browser. )

What language do you want to use?? [ Swift / ObjC ]
Would you like to include a demo application with your library? [ Yes / No ]
 > No

Which testing frameworks will you use? [ Quick / None ]
 > None

Would you like to do view based testing? [ Yes / No ]
 > No
/Users/a/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/nanaimo-0.1.0/lib/nanaimo/reader.rb:61:in `initialize': uninitialized constant Nanaimo::Reader::StringScanner (NameError)
    from /Users/a/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/xcodeproj-1.4.0/lib/xcodeproj/plist.rb:27:in `new'
    from /Users/a/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/xcodeproj-1.4.0/lib/xcodeproj/plist.rb:27:in `read_from_path'
    from /Users/a/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:200:in `initialize_from_file'
    from /Users/a/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:102:in `open'
    from /Users/a/test-lib/setup/ProjectManipulator.rb:30:in `run'
    from /Users/a/test-lib/setup/ConfigureSwift.rb:49:in `perform'
    from /Users/a/test-lib/setup/ConfigureSwift.rb:7:in `perform'
    from /Users/a/test-lib/setup/TemplateConfigurator.rb:76:in `run'
    from ./configure:9:in `<main>'

To learn more about the template see ``.
To learn more about creating a new pod, see ``.

Folder looks like:

Podspec looks like

# Be sure to run `pod lib lint ${POD_NAME}.podspec' to ensure this is a
# valid spec before submitting.
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see
# do |s|             = '${POD_NAME}'
  s.version          = '0.1.0'
  s.summary          = 'A short description of ${POD_NAME}.'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
TODO: Add long description of the pod here.

  s.homepage         = '<GITHUB_USERNAME>/${POD_NAME}'
  # s.screenshots     = '', ''
  s.license          = { :type => 'MIT', :file => 'LICENSE' }           = { '${USER_NAME}' => '${USER_EMAIL}' }
  s.source           = { :git => '<GITHUB_USERNAME>/${POD_NAME}.git', :tag => s.version.to_s }
  # s.social_media_url = '<TWITTER_USERNAME>'

  s.ios.deployment_target = '8.0'

  s.source_files = '${POD_NAME}/Classes/**/*'

  # s.resource_bundles = {
  #   '${POD_NAME}' => ['${POD_NAME}/Assets/*.png']
  # }

  # s.public_header_files = 'Pod/Classes/**/*.h'
  # s.frameworks = 'UIKit', 'MapKit'
  # s.dependency 'AFNetworking', '~> 2.3'

CocoaPods Environment


   CocoaPods : 1.1.1
        Ruby : ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin15]
    RubyGems : 2.6.7
        Host : Mac OS X 10.11.6 (15G1004)
       Xcode : 8.0 (8A218a)
         Git : git version 2.8.4 (Apple Git-73)
Ruby lib dir : /Users/a/.rbenv/versions/2.2.2/lib
Repositories : master - @ d30ee79362308df21fe8c0fcae753ead2468ae3d

Installation Source

Executable Path: /Users/a/.rbenv/versions/2.2.2/bin/pod


cocoapods-deintegrate : 1.0.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.1.1
cocoapods-try         : 1.1.0
25 Answers

βœ”οΈAccepted Answer

gem uninstall nanaimo

It will prompt you for which version to uninstall πŸ‘

Other Answers:

Uninstalling nanaimo-0.2.2 did it for me. Now I only have nanaimo-0.2.3.

Had to explicitly remove the old nanaimo 0.1.0. Now it works

@MaximusMcCann Thanks! finally could do pod init now πŸ‘

Ran sudo gem update
And then reran above, but receiving related error .. :/

/Users/a/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/xcodeproj-1.4.0/lib/xcodeproj/plist.rb:23:in `read_from_path': cannot load such file -- nanaimo (LoadError)
    from /Users/a/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:200:in `initialize_from_file'
    from /Users/a/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:102:in `open'
    from /Users/a/test-lib/setup/ProjectManipulator.rb:30:in `run'
    from /Users/a/test-lib/setup/ConfigureSwift.rb:49:in `perform'
    from /Users/a/test-lib/setup/ConfigureSwift.rb:7:in `perform'
    from /Users/a/test-lib/setup/TemplateConfigurator.rb:76:in `run'
    from ./configure:9:in `<main>'
gem list | grep plist
plist (3.2.0, 3.1.0)
gem list | grep xcodeproj
xcodeproj (1.4.0, 1.3.3)

Any thoughts?

Appreciate the help!

More Issues: