【问题标题】:unable to use cocoapods after updating更新后无法使用 cocoapods
【发布时间】:2014-12-10 14:15:46
【问题描述】:

我在我的 mac OSX 10.9.5 上更新了 Ruby、Gems 和 Cocoapods,更新后我无法执行命令

pod install

我从终端收到以下错误

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/user_interface/error_report.rb:13:in `report': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/command.rb:61: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.34.2/lib/cocoapods/command.rb:48:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/bin/pod:33:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'

我创建了一个包含以下内容的 Podfile

platform :ios, ‘7.1’

pod 'AFNetworking', '~> 1.3.3’

Cocoapods 在更新之前运行良好。任何帮助是极大的赞赏。

【问题讨论】:

    标签: ios ruby macos gem cocoapods


    【解决方案1】:

    这个字符“‘”与第一行的 cocoapods 不相容。 您应该使用它来代替“'”。所以你的 podfile 应该是这样的:

    platform :ios, '7.1'
    pod 'AFNetworking', '~> 2.4'
    

    【讨论】:

    • 感谢迷路,它实际上起作用了,奇怪的是 TextEdit 上的引号似乎没有错...
    • 谢谢你救了我...问题是我在 TextView 而不是 Xcode 中编辑它,可能是 TextEdit 将这些小麻烦转换为“'”
    • 无价!我永远不会想到这一点!
    • 在 TextWrangler 中编辑 PodFile 为我解决了这个问题,并且如前所述,删除了逗号。谢谢。
    【解决方案2】:

    问题是在 iOS 版本周围使用了不正确的引号。确保所有引号都是 ' 而不是 ' 或 '。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-23
      • 1970-01-01
      • 1970-01-01
      • 2015-09-28
      • 1970-01-01
      相关资源
      最近更新 更多