Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when install pod ,ERROR "Invalid `Podfile` file: undefined method `plateform'

Tags:

ios

cocoapods

I'am a new ios develper, I need to install 'AFNetworking'.

first, i have installed cocoapods;

second, i created a 'Podfile' in my wordspace;

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'AFNetworking'

then, i run pod install There is a ERROR:

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `open': No such file or directory - /Users/nemo/.cocoapods/repos (Errno::ENOENT)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `foreach'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `children'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:63:in `all'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface/error_report.rb:130:in `repo_information'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface/error_report.rb:34:in `report'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:58:in `report_error'
from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:300:in `handle_exception'
from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:274:in `rescue in run'
from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:264:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:45:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/bin/pod:43:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'
like image 912
Zk Liao Avatar asked Nov 26 '14 15:11

Zk Liao


People also ask

What is a Podfile in Xcode?

<What is a Podfile? The Podfile is a specification that describes the dependencies of the targets of one or more Xcode projects. The file should simply be named Podfile . All the examples in the guides are based on CocoaPods version 1.0 and onwards.


1 Answers

It would appear as though CocoaPods was not properly installed on your system.

Take a look at this response:

Cocoapods commands fail due to "No such file or directory @ dir_initialize - /Users/<username>/.cocoapods/repos (Errno::ENOENT)"

Try "pod setup" and then "pod install".

like image 95
ecramer Avatar answered Oct 09 '22 09:10

ecramer