简体   繁体   中英

Podfile error while doing “pod install”?

I made my own cocoa pods using this tutorial. http://guides.cocoapods.org/making/making-a-cocoapod.html I pushed it to my own github repository. https://github.com/kidsid59/appExample When I tried to use it in my own sample project by making an entry in its podfile like

target "PodInstallDemoApp" do

pod ‘appExample’, :git => 'https://github.com/kidsid59/appExample.git'

end

And then tried to run "pod install" in terminal. It says :-

[!] Invalid `Podfile` file: undefined local variable or method `‘appExample’' for #    <Pod::Podfile:0x007f92e111dfc0>. Updating CocoaPods might fix the issue.

Looks like its failing to identify the pod name. I already wasted lot of time in this little advice would help.

You probably have edited your Podfile with TextEdit.app, which replace ' for "smart quotes" ( ' and ' .

Be sure to use regular quotes ( ' ).

Note : You shouldn't use TextEdit App to edit the pod file because TextEdit likes to replace standard quotes with more graphically appealing quotes. This can cause CocoaPods to get confused and display errors, so it's best to just use Xcode or another programming text editor.

Using TextEdit App will give you following,

pod ‘AFNetworking’, ‘~> 2.5′    //notice the quotes

Use Xcode to open Podfile and you will get correct quotes as following,

pod 'AFNetworking', '~> 2.5'

Terminal Commands to open in Xcode:

$ touch Podfile  //OR $ cd <parentDirectory of Podfile>
$ open -a Xcode Podfile

Maybe it's because you don't have any tag ?

Try to do this:

$ git add -A && git commit -m "Release 0.0.1."
$ git tag '0.0.1'
$ git push --tags

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM