我在macOS塞拉利昂运行Cocoapods 1.1.1并使用Xcode 7.3.1
我用以下文本以纯文本格式创建了textedit中的Podfile:
platform :ios, ‘9.3’
project ‘cd/ls/Desktop/rexpense-ios-rexpenseiOS-Rodrigo/Rexpense/Rexpense/Rexpense.xcodeproj
def common_pods
pod 'AFNetworking', '~> 2.6.1'
pod 'MagicalRecord', '~> 2.3'
pod 'SVProgressHUD', '~> 1.1'
pod 'SDWebImage', '~> 3.7.3'
pod 'Rollbar', '~> 0.1.5'
pod 'ABStaticTableViewController', '~> 1.1'
pod 'GoogleAnalytics', '~> 3.13'
end
target 'Rexpense' do
common_pods
end我得到如下错误的语法:
[!] Invalid `Podfile` file: syntax error, unexpected tCONSTANT, expecting end-of-input
pod 'AFNetworking', '~> 2.6.1'
^.
# from /Users/rxasei/Podfile:23
# -------------------------------------------
# def common_pods
> pod 'AFNetworking', '~> 2.6.1'
# pod 'MagicalRecord', '~> 2.3'
# -------------------------------------------
[!] 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.发布于 2016-11-21 14:06:11
扩展到Gokul的评论,错误是绝对正确的。引号看起来可能是标准的,但是unicode表示实际上是不同的,这与TextEdit (实际上大多数其他RTF文本编辑器)处理引号的打开和结束的方式有关。可能有一个选项可以关闭这个选项,但我更喜欢使用为编码而设计的文本编辑器。
正如Gokul所提到的,xcode将很好地完成这项工作,但崇高文本对于这项工作的优化程度要高得多,而且您也没有一个非常需要资源的xcode来运行这样一个简单的任务。崇高的文本功能,代码完成,语法高亮和自动缩进。在我看来,这是一个很棒的文本编辑。我很欣赏这个答案是相当客观的,我相信其他人可能会有他们喜欢的其他文本编辑器。
您可以在这里获得崇高的文本:https://sublimetext.com/3
如果您用ST、delete和重新键入所有单引号打开podfile,您的错误就会消失。
https://stackoverflow.com/questions/40721766
复制相似问题