我安装了Cocoapods,并使用包含以下行的Atom创建了一个Podfile:
pod ‘Parse’, ‘~> 1.7.1′
pod ‘ParseUI’, ‘~> 1.1.3′
将此文件放入我的Xcode项目根目录,并在终端中运行“pod install”。显示如下:
[!]你的Podfile已经清理了智能报价。为了避免问题 未来,你不应该使用TextEdit进行编辑。如果你不是 使用TextEdit,您应该在编辑器中关闭智能引号 选择。
/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>'
我不确定我做错了什么,如果有人能给我一些建议 - 我会非常感激。谢谢。
答案 0 :(得分:71)
你不应该使用TextEdit编辑pod文件,因为TextEdit喜欢 用更具图形吸引力的报价替换标准报价。 这可能会导致CocoaPods混淆并显示错误,所以就是这样 最好只使用Xcode或其他编程文本编辑器。
TextEdit:
使用TextEdit将为您提供以下内容,
pod ‘Parse’, ‘~> 1.7.1′ //notice the quotes
要在TextEdit中关闭智能引号,请转到
TextEdit > Preferences > New Document > Options
Xcode:
要获得正确的引号,应该在打开Podfie时使用Xcode:
pod 'Parse', '~> 1.7.1'
使用Xcode app打开的终端命令:
$ touch Podfile //OR $ cd <parentDirectory of Podfile>
$ open -a Xcode Podfile
答案 1 :(得分:2)
我遇到了这个问题,因为在podfile中的注释中使用了一个智能引号。我暂时在podfile中找不到智能报价。智能引号有两个符号:'和'。确保从整个podfile中删除它们。
# Espressif’s ESP-TOUCH protocol implements Smart Config ...
答案 2 :(得分:0)
让某人使用Jenkins CI并在更正Podfile之后,错误无法解决。在奴隶上更新cocoapods版本有助于解决此错误。由于詹金斯无法查明问题并给出了这个一般性错误。