Skip to content
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

NoMethodError - undefined method `length' for nil:NilClass #6360

Closed
kurko opened this issue Dec 30, 2016 · 2 comments · Fixed by CocoaPods/Core#365
Closed

NoMethodError - undefined method `length' for nil:NilClass #6360

kurko opened this issue Dec 30, 2016 · 2 comments · Fixed by CocoaPods/Core#365
Labels
s4:awaiting validation A Pull Request that is waiting for validation by a CocoaPods Core Team member

Comments

@kurko
Copy link

kurko commented Dec 30, 2016

Command

/Users/kurko/.rbenv/versions/2.3.1/bin/pod trunk push UDSync.podspec

Report

  • What did you do?

Trying to push to trunk or just pod spec lint

  • What did you expect to happen?

To lint the podspec and push to trunk.

  • What happened instead?

I cannot lint the podspec. Here's the file: https://gist.github.com/kurko/2be54656f5e40b25cb72b424e0feab41

Stack

   CocoaPods : 1.2.0.beta.3 (happens on 1.1.1 as well)
        Ruby : ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
    RubyGems : 2.5.1
        Host : Mac OS X 10.12.2 (16C67)
       Xcode : 8.2 (8C38)
         Git : git version 2.11.0
Ruby lib dir : /Users/kurko/.rbenv/versions/2.3.1/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 49f2dafbb45084a12c67d25d5deb4b9ff6bdf247

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

Podfile

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

use_frameworks!
platform :ios, '10.0'

project 'UDSync' if respond_to?(:project)

target 'UDSync' do
  pod 'Alamofire', '~> 4'
  pod 'BrightFutures', '~> 5'
  pod 'SwiftyJSON', '~> 3'
end

target 'UDSyncTests' do
  pod 'Alamofire', '~> 4'
  pod 'BrightFutures', '~> 5'
  pod 'SwiftyJSON', '~> 3'
end

Error

NoMethodError - undefined method `length' for nil:NilClass
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.0.beta.3/lib/cocoapods-core/specification/linter.rb:254:in `_validate_description'
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.0.beta.3/lib/cocoapods-core/specification/linter.rb:177:in `block in run_validation_hooks'
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.0.beta.3/lib/cocoapods-core/specification/linter.rb:172:in `each'
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.0.beta.3/lib/cocoapods-core/specification/linter.rb:172:in `run_validation_hooks'
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.0.beta.3/lib/cocoapods-core/specification/linter.rb:128:in `run_root_validation_hooks'
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.0.beta.3/lib/cocoapods-core/specification/linter.rb:51:in `lint'
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.0.beta.3/lib/cocoapods/validator.rb:283:in `perform_linting'
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.0.beta.3/lib/cocoapods/validator.rb:78:in `validate'
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-trunk-1.1.2/lib/pod/command/trunk/push.rb:119:in `validate_podspec'
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-trunk-1.1.2/lib/pod/command/trunk/push.rb:64:in `run'
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.0.beta.3/lib/cocoapods/command.rb:52:in `run'
/Users/kurko/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.0.beta.3/bin/pod:55:in `<top (required)>'
/Users/kurko/.rbenv/versions/2.3.1/bin/pod:23:in `load'
/Users/kurko/.rbenv/versions/2.3.1/bin/pod:23:in `<main>'
@endocrimes
Copy link
Member

endocrimes commented Dec 30, 2016

Your problem should be fixed by setting the required summary property.

The bug appears to be in the way CocoaPods handles validation - namely in the case where the description field is set, but not summary, as it tries to compare the description and summaries lengths, but does not check for a nil summary.

I'm not completely sure as to how we should fix this. Maybe by bailing out early when props are missing?

@endocrimes endocrimes added the s4:awaiting validation A Pull Request that is waiting for validation by a CocoaPods Core Team member label Dec 31, 2016
@kurko
Copy link
Author

kurko commented Jan 4, 2017

Thanks for being great, @dantoml 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s4:awaiting validation A Pull Request that is waiting for validation by a CocoaPods Core Team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants