Cocoapods pod install gives undefined inherit method

I get this strange error. If I look at the cocoapod specs, it seems like valid syntax. What am I doing wrong?

[!] Invalid `Podfile` file: undefined method `inherit!' for #<Pod::Podfile:0x007fad141d1050>. Updating CocoaPods might fix the issue. # from /Users/Downloads/EarlGrey-master/Demo/EarlGreyExample/Podfile:28 # ------------------------------------------- # target TEST_TARGET do > inherit! :search_paths # pod 'EarlGrey' 
+6
source share
3 answers

Open your subfile and delete the Project_Tests block.

eg,

The following error:

 use_frameworks! target 'MyPodProject_Example' do pod 'MyPodProject', :path => '../' target 'MyPodProject_Tests' do inherit! :search_paths end end 

Successful:

 use_frameworks! target 'MyPodProject_Example' do pod 'MyPodProject', :path => '../' end 

Then do the pod update (in terminal). This will create .xcworkspace

+5
source

Make sure you have the latest version of Cocoapods installed. As Zoidberg has already been mentioned, you need to have at least version 1.0 (which is now stable) in order to support β€œinherit”.

 sudo gem install cocoapods 

At the same time, your pod install should not give you any errors.

+3
source

I am facing a similar problem, this is what worked for me

 sudo gem install cocoapods --pre 

this will basically install cocoapods version 1.0.0.beta.6, which has "inherit"

+1
source

All Articles