我收到了这个奇怪的错误.如果我查看cocoapod规范,这似乎是一个有效的语法.我究竟做错了什么.?
[!] 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'
Run Code Online (Sandbox Code Playgroud)
打开Podfile并删除Project_Tests块.
例如,
以下给出错误:
use_frameworks!
target 'MyPodProject_Example' do
pod 'MyPodProject', :path => '../'
target 'MyPodProject_Tests' do
inherit! :search_paths
end
end
Run Code Online (Sandbox Code Playgroud)
成功:
use_frameworks!
target 'MyPodProject_Example' do
pod 'MyPodProject', :path => '../'
end
Run Code Online (Sandbox Code Playgroud)
然后执行pod更新(在终端中).这将创建.xcworkspace
我面临类似的问题,这对我有用
sudo gem install cocoapods --pre
Run Code Online (Sandbox Code Playgroud)
这将基本上安装具有“继承”功能的 1.0.0.beta.6 版本的 cocoapods