【问题标题】:Trouble installing CocoaPods - already tried solution given elsewhere安装 CocoaPods 时遇到问题 - 已经在其他地方尝试过解决方案
【发布时间】:2015-10-23 08:23:10
【问题描述】:

我在安装 CocoaPods 时遇到问题。我已经用谷歌搜索了一个解决方案,并按照How do I select a project in my Podfile? I'm getting the error: Unable to find the Xcode project for the target 'Pods' 中的答案进行了操作。谁能说我做错了什么?

Michaels-MacBook-Air:~ michael$ cd  ~/Documents/Chinese\ Restaurants/
Michaels-MacBook-Air:Chinese Restaurants michael$ pod install
[in /Users/michael]
Analyzing dependencies
[!] Could not automatically select an Xcode project. Specify one in your Podfile like so:

    xcodeproj 'path/to/Project.xcodeproj'

Michaels-MacBook-Air:Chinese Restaurants michael$ cd  ~/Documents/Chinese\ Restaurants/Chinese\ Restaurants.xcodeproj/
Michaels-MacBook-Air:Chinese Restaurants.xcodeproj michael$ pod setup
Setting up CocoaPods master repo
Already up-to-date.
Setup completed (read-only access)
Michaels-MacBook-Air:Chinese Restaurants.xcodeproj michael$ touch Podfile
Michaels-MacBook-Air:Chinese Restaurants.xcodeproj michael$ open -e Podfile
Michaels-MacBook-Air:Chinese Restaurants.xcodeproj michael$ pod install
Analyzing dependencies
[!] Could not automatically select an Xcode project. Specify one in your Podfile like so:

    xcodeproj 'path/to/Project.xcodeproj'

【问题讨论】:

    标签: cocoapods


    【解决方案1】:

    在我的情况下,错误是因为我的 Xcode 项目中有 两个 .xcodeproj 文件。

    所以解决方案是删除不必要的.xcodeproj 文件,然后再做一次

    pod install
    

    【讨论】:

      【解决方案2】:

      我尝试在 vim 中编辑文件,如 https://www.youtube.com/watch?v=9_FbAlq2g9o,然后解决了它。希望知道这对其他人有用。

      【讨论】:

        【解决方案3】:

        这里是解决方案。事实上解决方案已经很清楚了。

         Could not automatically select an Xcode project. Specify one in your Podfile like so:
        
        xcodeproj 'path/to/Project.xcodeproj'
        

        我无法理解上面的提示。后来我明白了。

        首先,您应该运行终端并 cd 进入您的项目目录。 其次,输入“vim podfile”并运行。 第三,单击按钮“i”并更改为编辑模式。 第四,现在你可以输入'xcodeproj projectname.xcodeproj' 然后,单击 ESC 并输入 ':wq'。这意味着保存并退出。 最后,你重新输入 'pod install' 就可以正常运行了。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2020-08-30
          • 2020-05-07
          • 2014-07-07
          • 2012-02-01
          • 2020-06-28
          • 2022-01-03
          • 1970-01-01
          相关资源
          最近更新 更多