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/

相关文章:

xcode - 测试 NSLog 输出

javascript - 从脚本标签中提取 src 属性并根据特定匹配进行解析

objective-c - CocoaPods 不为 iOS7 和 Xcode 5 安装 Pod

ios - CocoaPods 更新正在降级已安装的 pod

ios - Xcode 6.1 : UITableViewcontroller template empty

objective-c - 在 Cocoa Mac Os X 桌面应用程序中,我可以配置项目以便将没有扩展名的文件拖到应用程序的图标中吗?

swift - 如何用 Swift 填充 UIBezierPath 的内部?

javascript - 解析 JavaScript 以检测代码

java - 在java中解析文本文件,如何删除 ""

ios - 如何在 Flutter 插件的 Swift 编写的 iOS 部分中使用 Objective-C 框架