Cocoapods: NoMethodError - undefined method `each' for "":String

Created on 27 May 2016  ยท  4Comments  ยท  Source: CocoaPods/CocoaPods

MacBook-Pro-de-leonardo:Objective-C leonardo$ pod install
Analyzing dependencies
Fetching podspec for stickynote from stickyapi

โ€•โ€•โ€• MARKDOWN TEMPLATE โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•

Command

/usr/local/bin/pod install

Report

  • What did you do?
  • What did you expect to happen?
  • What happened instead?

    Stack

   CocoaPods : 1.0.0
        Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
    RubyGems : 2.0.14.1
        Host : Mac OS X 10.11.4 (15E65)
       Xcode : 7.3.1 (7D1014)
         Git : git version 2.7.4 (Apple Git-66)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 17db513ddb6a4c49ae952eed1e8ab6193c620cb2

Plugins

cocoapods-deintegrate : 1.0.0
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.0.0
cocoapods-try         : 1.0.0

Podfile

# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
# use_frameworks!

target 'stickynotes' do

pod 'stickynote', :path => 'stickyapi'

end

Error

NoMethodError - undefined method `each' for "":String
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.0.0/lib/cocoapods-core/specification/root_attribute_accessors.rb:190:in `convert_keys_to_symbol'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.0.0/lib/cocoapods-core/specification/root_attribute_accessors.rb:107:in `source'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.0.0/lib/cocoapods-core/specification/linter.rb:109:in `block in check_required_attributes'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.0.0/lib/cocoapods-core/specification/linter.rb:108:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.0.0/lib/cocoapods-core/specification/linter.rb:108:in `check_required_attributes'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.0.0/lib/cocoapods-core/specification/linter.rb:50:in `lint'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/validator.rb:251:in `perform_linting'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/validator.rb:80:in `validate'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/external_sources/abstract_external_source.rb:173:in `block in validate_podspec'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/config.rb:39:in `with_changes'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/external_sources/abstract_external_source.rb:172:in `validate_podspec'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/external_sources/abstract_external_source.rb:163:in `store_podspec'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/external_sources/path_source.rb:17:in `block in fetch'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/user_interface.rb:84:in `titled_section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:479:in `fetch_external_source'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:455:in `block (2 levels) in fetch_external_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:454:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:454:in `block in fetch_external_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/user_interface.rb:63:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:453:in `fetch_external_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer/analyzer.rb:73:in `analyze'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer.rb:227:in `analyze'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer.rb:151:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/user_interface.rb:63:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer.rb:150:in `resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/installer.rb:114:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/command/install.rb:37:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.0/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/lib/cocoapods/command.rb:50:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.0/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

โ€•โ€•โ€• TEMPLATE END โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•โ€•

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=undefined+method+%60each%27+for+%22%22%3AString&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

defect

Most helpful comment

I've insert the git repository URL on source and it has worked.
I've also integrated the homepage:

s.homepage = "http://www.domain.com"
s.source = { :git => 'https://git.domain.core.git' }

Thanks

All 4 comments

Can you share the podspec for "stickynote" as well, please? It most likely has a syntax error that isn't handled gracefully.

Hi, I've updated cocoapods and then I've started to receive the same error.

By debugging it, I've found the dependency that is shotting this error is the 'Core'. Take a look into my podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
def a  
    pod 'LXReorderableCollectionViewFlowLayout', :git => 'https://github.com/winkapp/LXReorderableCollectionViewFlowLayout.git', :commit => "be2dbf4766b9308e7d1e568bee5fae0a02ed6873"
    pod 'Core', :git => 'https://git.domain.core.git', :commit => 'e409bae'
    pod 'Fabric'
    pod 'Crashlytics'
    pod 'DTCoreText'
    pod 'TTSwitch', '0.0.6' 
end

target 'a-test' do
    a
end

target 'a-stage' do
    a
end

target 'a-live' do
    a
end`

If I comment the Core, it works properly.

The core pod spec is like this:

Pod::Spec.new do |s|

  s.name         = "Core"
  s.version      = "2.0"
  s.summary      = "Basic code for projects."
  s.author       = { "Lorem" => "[email protected]" }
  s.platform     = :ios, "7.0"
  s.requires_arc = true

  s.source       = "~"
  s.source_files  = "Core", "Core/**/*.{h,m}"
  s.resources = ['Core/**/_.{png,xib}']
  s.resource_bundle = { 'Core-Localization' => 'Core/Core/Localization/_', 'Core-Fonts' => 'Core/Core/Fonts/*'}

  s.dependency "ACEDrawingView", "1.3.7"
  s.dependency "AFNetworking", "2.6.1"
  s.dependency "AFOAuth2Manager", "2.2.0"
  s.dependency "PSAlertView", "2.0.3"
  s.dependency "CocoaLumberjack", "2.2.0"
  s.dependency "EDStarRating", "1.1"
  s.dependency "FMDB", "2.5"
  s.dependency "FXImageView", "1.3.5"
  s.dependency "LXReorderableCollectionViewFlowLayout", "0.1.1"
  s.dependency "MBProgressHUD", "0.9.1"
  s.dependency "PSTAlertController", "1.1.0"
  s.dependency "SSZipArchive", "0.3.2"

end `

Can you see any syntax mistake on it?

Thanks in advance.

Ah, source needs to be a hash. The linter in Core should handle this better

I've insert the git repository URL on source and it has worked.
I've also integrated the homepage:

s.homepage = "http://www.domain.com"
s.source = { :git => 'https://git.domain.core.git' }

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pronebird picture pronebird  ยท  3Comments

Mingmingmew picture Mingmingmew  ยท  3Comments

gerchicov-bp picture gerchicov-bp  ยท  3Comments

evermeer picture evermeer  ยท  3Comments

sonu5 picture sonu5  ยท  3Comments