xcode - 在终端中的Podfile上使用Pod Install命令时出错

标签 xcode parsing cocoapods ipod podfile

我已经安装了Cocoapods,并使用Atom创建了一个Podfile,其中包含以下几行:

pod ‘Parse’, ‘~> 1.7.1′
pod ‘ParseUI’, ‘~> 1.1.3′

将此文件放入我的Xcode项目根目录后,在Terminal中运行“pod install”。显示如下:

[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.



Screenshot added
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.38.2/lib/cocoapods-core/standard_error.rb:87:in `message': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:367:in `handle_exception'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:315:in `rescue in run'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:303:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/command.rb:48:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/bin/pod:44:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'

我不确定如果有人可以给我一些建议,我做错了什么,将不胜感激。谢谢。

最佳答案

You shouldn’t use TextEdit to edit the pod file because TextEdit likes to replace standard quotes with more graphically appealing quotes. This can cause CocoaPods to get confused and display errors, so it’s best to just use Xcode or another programming text editor.



文本编辑:

使用TextEdit将为您提供以下内容,
pod ‘Parse’, ‘~> 1.7.1′    //notice the quotes

要在TextEdit中关闭智能引号,请转到
TextEdit > Preferences > New Document > Options

Xcode:

为了获得正确的报价,您应该在打开Podfie时使用Xcode:
pod 'Parse', '~> 1.7.1'

使用Xcode应用程序打开的终端命令:
$ touch Podfile  //OR $ cd <parentDirectory of Podfile>
$ open -a Xcode Podfile

关于xcode - 在终端中的Podfile上使用Pod Install命令时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31832538/

相关文章:

ios - SwiftUI - NavigationLink View 中的 NavigationBar 快速显示然后消失

ios - Swift 从 Nib 创建自定义 View

ios - UIScroll View 额外高度并忽略约束

python:是否有作为生成器实现的 XML 解析器?

xcode - 如何让Xcode 7.3.1识别IB中的自定义框架

PHP 应用程序内存不足

javascript - Atom 文本编辑器如何解析/标记代码? (语法高亮)

firebase - 获取 "CocoaPods could not find compatible versions for pod "Firebase/数据库“” flutter 错误

react-native - React Native use_native_modules 文档

ios - Cocoapod 库 - 维护多个版本