安装cocoaPods时出现的错误


安装cocoaPods时出现的错误_第1张图片   


一开始 我在podfile  写的 “pod 'ReactiveCocoa', ‘2.0’” 后来改成 “pod 'ReactiveCocoa', ”2.0“ ”(双引号的)



 [!] Invalid `Podfile` file: undefined local variable or method `en_US' for #. Updating CocoaPods might fix the issue.

     这是编码的问题


  查看编码,终端中输入:

     locale

     你会看到如下信息:

     LANG="zh_CN.UTF-8"

     LC_COLLATE="zh_CN.UTF-8"

     LC_CTYPE="zh_CN.UTF-8"

     LC_MESSAGES="zh_CN.UTF-8"

     LC_MONETARY="zh_CN.UTF-8"

     LC_NUMERIC="zh_CN.UTF-8"

     LC_TIME="zh_CN.UTF-8"

     LC_ALL=

     发现都是zh,如要转换一下:

     终端中输入:
      export LC_ALL=en_US.UTF-8  

      export LANG=en_US.UTF-8

      这个时候你可以继续执行了。

       慢着,这时你最好先cd到你的项目的根目录下

       打开前面你创建的Podfile文件,终端中输入:

      vim Podfile

     然后将文件中的内容清空,重新编辑一遍,保存退出。





[!] Invalid `Podfile` file: undefined method `plaplatform' for #. Updating CocoaPods might fix the issue.



 #  from /Users/mac/Desktop/menyingjin/XX/Podfile:1
 #  -------------------------------------------
 >  plaplatform :ios, '7.0'
 #  pod "AFNetworking", "~> 2.1.1"

 #  ------------------------------

原来是 podfile 文件里写错了

只写了 “platform :ios, '7.1'
pod "AFNetworking", "~> 2.0"”

别人给我发了一下cocoapodguide   http://cocoapods.org/

原来是少了source 'https://github.com/CocoaPods/Specs.git'。






你可能感兴趣的:(iOS)