New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MaximusMcCann opened this Issue Oct 29, 2016 · 24 comments

Comments

Projects
None yet
@MaximusMcCann

MaximusMcCann commented Oct 29, 2016

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 https://gems.ruby-china.org/ instead of https://gems.ruby-china.org/ for the RC see #5910

Report

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 `https://github.com/CocoaPods/pod-template.git` 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:
 - http://guides.cocoapods.org/making/using-pod-lib-create.html
 ( hold cmd and click links to open in a browser. )


What language do you want to use?? [ Swift / ObjC ]
 >
swift
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 `https://github.com/CocoaPods/pod-template.git`.
To learn more about creating a new pod, see `http://guides.cocoapods.org/making/making-a-cocoapod`.

Folder looks like:
image

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 http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = '${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.
                       DESC

  s.homepage         = 'https://github.com/<GITHUB_USERNAME>/${POD_NAME}'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { '${USER_NAME}' => '${USER_EMAIL}' }
  s.source           = { :git => 'https://github.com/<GITHUB_USERNAME>/${POD_NAME}.git', :tag => s.version.to_s }
  # s.social_media_url = 'https://twitter.com/<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'
end

CocoaPods Environment

Stack

   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 - https://github.com/CocoaPods/Specs.git @ d30ee79362308df21fe8c0fcae753ead2468ae3d

Installation Source

Executable Path: /Users/a/.rbenv/versions/2.2.2/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.1
cocoapods-try         : 1.1.0
@DanToml

This comment has been minimized.

Show comment
Hide comment
@DanToml

DanToml Oct 29, 2016

Member

@MaximusMcCann this was fixed in nanaimo 0.1.1, please run gem install nanaimo -v 0.1.2 then try again

Member

DanToml commented Oct 29, 2016

@MaximusMcCann this was fixed in nanaimo 0.1.1, please run gem install nanaimo -v 0.1.2 then try again

@DanToml DanToml closed this Oct 29, 2016

@MaximusMcCann

This comment has been minimized.

Show comment
Hide comment
@MaximusMcCann

MaximusMcCann commented Oct 29, 2016

Cheers!!

@MaximusMcCann

This comment has been minimized.

Show comment
Hide comment
@MaximusMcCann

MaximusMcCann Oct 29, 2016

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!

MaximusMcCann commented Oct 29, 2016

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!

@DanToml

This comment has been minimized.

Show comment
Hide comment
@DanToml

DanToml Oct 29, 2016

Member

@MaximusMcCann You shouldn't need sudo if you're using rbenv. Now it looks like nanaimo is not in your gem path?

what's the output of gem list | nanaimo?

Member

DanToml commented Oct 29, 2016

@MaximusMcCann You shouldn't need sudo if you're using rbenv. Now it looks like nanaimo is not in your gem path?

what's the output of gem list | nanaimo?

@MaximusMcCann

This comment has been minimized.

Show comment
Hide comment
@MaximusMcCann

MaximusMcCann Oct 29, 2016

hmm...

gem list | nanaimo
zsh: command not found: nanaimo

MaximusMcCann commented Oct 29, 2016

hmm...

gem list | nanaimo
zsh: command not found: nanaimo
@DanToml

This comment has been minimized.

Show comment
Hide comment
@DanToml

DanToml Oct 29, 2016

Member

Please can you try gem install nanaimo -v 0.1.2 or use Bundler?

Member

DanToml commented Oct 29, 2016

Please can you try gem install nanaimo -v 0.1.2 or use Bundler?

@MaximusMcCann

This comment has been minimized.

Show comment
Hide comment
@MaximusMcCann

MaximusMcCann Oct 29, 2016

Looks like I must have set something up incorrectly to start :/

Had to refresh my shell

gem install nanaimo -v 0.1.2
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_sysopen - /Users/a/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/nanaimo-0.1.2/.gitignore

➜  sudo gem install nanaimo -v 0.1.2
Successfully installed nanaimo-0.1.2
Parsing documentation for nanaimo-0.1.2
Done installing documentation for nanaimo after 0 seconds
1 gem installed

➜  gem list | grep nanaimo
nanaimo (0.1.2, 0.1.0)

reloaded shell, but still ``read_from_path': cannot load such file -- nanaimo (LoadError)`

MaximusMcCann commented Oct 29, 2016

Looks like I must have set something up incorrectly to start :/

Had to refresh my shell

gem install nanaimo -v 0.1.2
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_sysopen - /Users/a/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/nanaimo-0.1.2/.gitignore

➜  sudo gem install nanaimo -v 0.1.2
Successfully installed nanaimo-0.1.2
Parsing documentation for nanaimo-0.1.2
Done installing documentation for nanaimo after 0 seconds
1 gem installed

➜  gem list | grep nanaimo
nanaimo (0.1.2, 0.1.0)

reloaded shell, but still ``read_from_path': cannot load such file -- nanaimo (LoadError)`

@DanToml

This comment has been minimized.

Show comment
Hide comment
@DanToml

DanToml Oct 29, 2016

Member

🤔 - I'm honestly not too sure. It looks like there's something funky with your ruby env. Could you try http://guides.cocoapods.org/using/a-gemfile.html?

Member

DanToml commented Oct 29, 2016

🤔 - I'm honestly not too sure. It looks like there's something funky with your ruby env. Could you try http://guides.cocoapods.org/using/a-gemfile.html?

@MaximusMcCann

This comment has been minimized.

Show comment
Hide comment
@MaximusMcCann

MaximusMcCann Oct 29, 2016

Will try. Thank you for the help!

MaximusMcCann commented Oct 29, 2016

Will try. Thank you for the help!

@MaximusMcCann

This comment has been minimized.

Show comment
Hide comment
@MaximusMcCann

MaximusMcCann Oct 29, 2016

Got bundle to work. The key: cannot add a hyphen to the pod name so test-lib failed, but testLib works!

Still not working without bundle exec, but that's on me. Thanks @DanToml for the quick help!

MaximusMcCann commented Oct 29, 2016

Got bundle to work. The key: cannot add a hyphen to the pod name so test-lib failed, but testLib works!

Still not working without bundle exec, but that's on me. Thanks @DanToml for the quick help!

@MaximusMcCann

This comment has been minimized.

Show comment
Hide comment
@MaximusMcCann

MaximusMcCann Oct 29, 2016

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

MaximusMcCann commented Oct 29, 2016

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

@aldocyanlabs

This comment has been minimized.

Show comment
Hide comment
@aldocyanlabs

aldocyanlabs Oct 31, 2016

@MaximusMcCann hi I've same problem. How to remove the old nanaimo?

aldocyanlabs commented Oct 31, 2016

@MaximusMcCann hi I've same problem. How to remove the old nanaimo?

@MaximusMcCann

This comment has been minimized.

Show comment
Hide comment
@MaximusMcCann

MaximusMcCann Oct 31, 2016

gem uninstall nanaimo

It will prompt you for which version to uninstall 👍

MaximusMcCann commented Oct 31, 2016

gem uninstall nanaimo

It will prompt you for which version to uninstall 👍

@aldocyanlabs

This comment has been minimized.

Show comment
Hide comment
@aldocyanlabs

aldocyanlabs Oct 31, 2016

@MaximusMcCann Thanks! finally could do pod init now 👍

aldocyanlabs commented Oct 31, 2016

@MaximusMcCann Thanks! finally could do pod init now 👍

@BrianBatchelder

This comment has been minimized.

Show comment
Hide comment
@BrianBatchelder

BrianBatchelder Dec 2, 2016

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

BrianBatchelder commented Dec 2, 2016

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

@WPDreamMelody

This comment has been minimized.

Show comment
Hide comment
@WPDreamMelody

WPDreamMelody Dec 22, 2016

Uninstalling nanaimo-0.2.2 did it for me. it work very well!

WPDreamMelody commented Dec 22, 2016

Uninstalling nanaimo-0.2.2 did it for me. it work very well!

@Rjmaurya13

This comment has been minimized.

Show comment
Hide comment
@Rjmaurya13

Rjmaurya13 Jan 9, 2017

Install cocoa pods by this way.
sudo gem install -n /usr/local/bin cocoapods

Rjmaurya13 commented Jan 9, 2017

Install cocoa pods by this way.
sudo gem install -n /usr/local/bin cocoapods

@briankuyath

This comment has been minimized.

Show comment
Hide comment
@briankuyath

briankuyath Mar 16, 2017

Uninstalling nanaimo-0.2.2 did it for me too! Thanks!

briankuyath commented Mar 16, 2017

Uninstalling nanaimo-0.2.2 did it for me too! Thanks!

@miljann

This comment has been minimized.

Show comment
Hide comment
@miljann

miljann Mar 21, 2017

sudo gem update worked for me :)

miljann commented Mar 21, 2017

sudo gem update worked for me :)

@AyeChanPyaeSone

This comment has been minimized.

Show comment
Hide comment
@AyeChanPyaeSone

AyeChanPyaeSone Mar 28, 2017

Uninstalling nanaimo-0.2.2 did it for me too! Thanks you!

AyeChanPyaeSone commented Mar 28, 2017

Uninstalling nanaimo-0.2.2 did it for me too! Thanks you!

@theewind

This comment has been minimized.

Show comment
Hide comment
@theewind

theewind Apr 28, 2017

I resolve this problem when i switch ruby version 2.1.1 to 2.2.4

theewind commented Apr 28, 2017

I resolve this problem when i switch ruby version 2.1.1 to 2.2.4

@Danny182

This comment has been minimized.

Show comment
Hide comment
@Danny182

Danny182 Jun 12, 2017

Uninstalling old versions of Nanaimo worked!

Danny182 commented Jun 12, 2017

Uninstalling old versions of Nanaimo worked!

charlesbedrosian added a commit to charlesbedrosian/moodle-local-moodlemobile2 that referenced this issue Aug 16, 2017

@re7ty

This comment has been minimized.

Show comment
Hide comment
@re7ty

re7ty Dec 15, 2017

Probably your project file is corrupted try to use https://github.com/Karumi/Kin to figure it out

re7ty commented Dec 15, 2017

Probably your project file is corrupted try to use https://github.com/Karumi/Kin to figure it out

@betzerra

This comment has been minimized.

Show comment
Hide comment
@betzerra

betzerra Apr 16, 2018

$ gem uninstall nanaimo

Select gem to uninstall:
 1. nanaimo-0.2.3
 2. nanaimo-0.2.4
 3. nanaimo-0.2.5
 4. All versions

Uninstalled 0.2.3 and 0.2.5. Worked for me. Maybe having more than one version triggers the issue? Dunno.

betzerra commented Apr 16, 2018

$ gem uninstall nanaimo

Select gem to uninstall:
 1. nanaimo-0.2.3
 2. nanaimo-0.2.4
 3. nanaimo-0.2.5
 4. All versions

Uninstalled 0.2.3 and 0.2.5. Worked for me. Maybe having more than one version triggers the issue? Dunno.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment