【问题标题】:when install pod ,ERROR "Invalid `Podfile` file: undefined method `plateform'安装 pod 时,错误“无效的 `Podfile` 文件:未定义的方法 `plateform'
【发布时间】:2014-11-26 15:13:47
【问题描述】:

我是一个新的 ios 开发者,我需要安装“AFNetworking”。

首先,我已经安装了 cocoapods;

其次,我在我的文字空间中创建了一个“Podfile”;

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

然后,我跑 pod install 有一个错误:

/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>'

【问题讨论】:

    标签: ios cocoapods


    【解决方案1】:

    看起来好像 CocoaPods 没有正确安装在您的系统上。

    看看这个回复:

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

    尝试“pod setup”,然后“pod install”。

    【讨论】:

      【解决方案2】:

      第二行:plateform :ios, '8.0' 拼写错误。应该是:platform :ios, '8.0'

      【讨论】:

      • 哦!谢谢,但是现在,一个新的错误
      猜你喜欢
      • 2022-11-05
      • 2017-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-27
      • 2023-03-25
      相关资源
      最近更新 更多