Cocoapods: NoMethodError - undefined method `map' for "Alamofire":String

Created on 3 Apr 2018  Â·  2Comments  Â·  Source: CocoaPods/CocoaPods

Command

/usr/local/bin/pod install

Report

  • What did you do?
    First I wrote s.dependency = '...', which caused an error:
    >Did you mean? dependency
    dependencies=
    dependencies.

So, I tried s.dependencies = '...', which caused a bigger error.

  • What did you expect to happen?

Please note that I am aware that the correct syntax is s.dependency '...' (without the equal sign). What I expected to happen is a graceful error message suggesting that the syntax s.dependencies = '...' was wrong (instead of a big error asking to report the issue).

Stack

Please note that the same issue is affecting both 1.4.0 and 1.5.0.beta.1, so it's not a regression.

   CocoaPods : 1.5.0.beta.1
        Ruby : ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
    RubyGems : 2.7.6
        Host : Mac OS X 10.13.4 (17E199)
       Xcode : 9.3 (9E145)
         Git : git version 2.16.2
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : englishtown-pods-repo - ssh://[email protected]:7999/mobile/pods-repo.git @ c3a3097d2e40aa36dbf90c11566dab9a78f4a017
               master - https://github.com/CocoaPods/Specs.git @ 7d0d8b463b97452b797554809c1b2c5b23f99aff

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Podfile

use_frameworks!

target 'podmix_Example' do
  pod 'podmix', :path => '../'

  target 'podmix_Tests' do
    inherit! :search_paths
  end
end

Podspec

Pod::Spec.new do |s|
  s.name             = 'podmix'
  s.version          = '0.1.0'
  s.summary          = 'A short description of podmix.'
  s.description      = 'A long description of the pod here.'

  s.homepage         = 'https://github.com/coeur/podmix'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'coeur' => '[email protected]' }
  s.source           = { :git => 'https://github.com/coeur/podmix.git', :tag => s.version.to_s }

  s.ios.deployment_target = '8.0'
  s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
  s.swift_version = '4.0'

  s.frameworks = 'UIKit', 'AVFoundation'
  s.source_files = 'mix/Classes/**/*.{h,m,swift}'
  s.dependencies = 'Alamofire'
end

Error

NoMethodError - undefined method `map' for "Alamofire":String
Did you mean?  tap
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.5.0.beta.1/lib/cocoapods-core/specification/consumer.rb:209:in `dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.5.0.beta.1/lib/cocoapods-core/specification.rb:326:in `block in dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.5.0.beta.1/lib/cocoapods-core/specification.rb:325:in `map'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.5.0.beta.1/lib/cocoapods-core/specification.rb:325:in `dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/validator.rb:36:in `initialize'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/external_sources/abstract_external_source.rb:191:in `new'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/external_sources/abstract_external_source.rb:191:in `validator_for_podspec'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/external_sources/abstract_external_source.rb:178:in `validate_podspec'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/external_sources/abstract_external_source.rb:173:in `store_podspec'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/external_sources/path_source.rb:17:in `block in fetch'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/user_interface.rb:85:in `titled_section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/installer/analyzer.rb:697:in `fetch_external_source'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/installer/analyzer.rb:673:in `block (2 levels) in fetch_external_sources'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/installer/analyzer.rb:672:in `each'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/installer/analyzer.rb:672:in `block in fetch_external_sources'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/installer/analyzer.rb:671:in `fetch_external_sources'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/installer/analyzer.rb:85:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/installer.rb:243:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/installer.rb:116:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/command/install.rb:41:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.0.beta.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
easy help wanted enhancement

Most helpful comment

I guess we can do better on the error message?

All 2 comments

It should be s.dependency ‘Alamofire’

I guess we can do better on the error message?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luhui picture luhui  Â·  3Comments

spencerkohan picture spencerkohan  Â·  3Comments

hmistry picture hmistry  Â·  3Comments

pronebird picture pronebird  Â·  3Comments

soleares picture soleares  Â·  3Comments