Cocoapods: pod install fails with undefined method `this` on a specific project

Created on 21 Mar 2017  路  6Comments  路  Source: CocoaPods/CocoaPods

Report

What did you do?

Run pod install
Run pod update
Run pod env

What did you expect to happen?

Install all pod dependencies correctly.

What happened instead?

Every Pod command fails with this error:

/Users/katunch/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:2158:in `method_missing': undefined method `this' for #<Gem::Specification:0x3fdc22053e9c cocoapods-1.2.0> (NoMethodError)
    from /Users/katunch/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:1057:in `find_active_stub_by_path'
    from /Users/katunch/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:64:in `require'
    from /Users/katunch/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.2.0/bin/pod:36:in `<top (required)>'
    from /Users/katunch/.rvm/gems/ruby-2.3.0/bin/pod:23:in `load'
    from /Users/katunch/.rvm/gems/ruby-2.3.0/bin/pod:23:in `<main>'
    from /Users/katunch/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
    from /Users/katunch/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'

CocoaPods Environment

Executed from another directory

Stack

   CocoaPods : 1.2.0
        Ruby : ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin16]
    RubyGems : 2.5.1
        Host : Mac OS X 10.12.3 (16D32)
       Xcode : 8.2.1 (8C1002)
         Git : git version 2.10.1 (Apple Git-78)
Ruby lib dir : /Users/katunch/.rvm/rubies/ruby-2.3.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 983127394fda12a8d1ceb6002e0b38316f3e5c20

Installation Source

Executable Path: /Users/katunch/.rvm/gems/ruby-2.3.0/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.2
cocoapods-try         : 1.1.0

Podfile

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'App' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for App
  # Core Stuff
  pod 'SwiftyBeaver'
  pod 'SOBRKit', :git => '[email protected]:sobr/sobrkit.git', :branch => 'master'
  pod 'SwiftEventBus', :tag => '2.1.2', :git => 'https://github.com/cesarferreira/SwiftEventBus.git'

  # UI Stuff
  pod 'SVProgressHUD'
  pod 'CDAlertView', :tag => '0.2.0', :git => 'https://github.com/candostdagdeviren/CDAlertView.git'
  pod 'Kingfisher'
  pod 'StarWars', '~> 2.0'
  pod 'GoogleMaps'
  pod 'TPKeyboardAvoiding'
  pod 'KMPlaceholderTextView', '~> 1.3.0'
  pod 'ASCalendar'

end

Project that demonstrates the issue

pod works as excepted in every other project. but not in this one. i can not provide the sources of this project because its under NDA. The Project is using custom xcconfig files which I have to merge every time after pod install. the project is building and running well. But at this time I can not run pod install anymore...

Most helpful comment

After reinstalling cocoapods it will work again..

pod worked in every project as excepted but not in this one. So i did the following just to try..

gem uninstall cocoapods -> removed the binaries too
gem cleanup
gem install cocoapods

After that it worked again in the mentioned project. But i don't know what exactly happened. it was just a try to reinstall cocoapods.

All 6 comments

After reinstalling cocoapods it will work again..

pod worked in every project as excepted but not in this one. So i did the following just to try..

gem uninstall cocoapods -> removed the binaries too
gem cleanup
gem install cocoapods

After that it worked again in the mentioned project. But i don't know what exactly happened. it was just a try to reinstall cocoapods.

@katunch uncertain either. Should we close the issue and re-open if you see it again?

@dnkoutso it's ok for me if this issue will be closed... next time it will happen i will reinstall cocoapods as a first step ;)
thx!

update RubyGems: gem update --system
I's works for me.

gem update --system worked for me - however I would suggest using gem cleanup if you know exactly what it does. You may want to keep some older revisions of non cocoapod gems around.

@dnkoutso I met the issue again when executed to push my private pod libraries, the error as below:
Invalid RYKit.podspec file: undefined method `join' for "Kingfisher":String.

Was this page helpful?
0 / 5 - 0 ratings