Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoapods pod install gives undefined method inherit

Tags:

cocoapods

I am getting this wierd error. If I look at the cocoapod specs, this seems like a 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'
like image 907
user1369024 Avatar asked Feb 17 '16 15:02

user1369024


2 Answers

Open your Podfile and Remove Project_Tests block.

for example,

Following Gives 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 pod update (in terminal). This will create the .xcworkspace

like image 137
PANKAJ VERMA Avatar answered Oct 13 '22 14:10

PANKAJ VERMA


Make sure you have the latest version of Cocoapods installed. As mentioned by Zoidberg, you need to have at least version 1.0 (which is now stable) in order to support 'inherit'.

sudo gem install cocoapods

With this your pod install should not give you any errors.

like image 42
rn3sto Avatar answered Oct 13 '22 13:10

rn3sto