Cocoapods install getting error [duplicate]

血红的双手。 提交于 2019-12-04 16:59:45

问题


Here is my Podfile:

platform :ios, ‘7.0’

pod 'ECSlidingViewController', '~> 2.0.0'

When I type pod install into the terminal, this is the error I get:

[!] Invalid `Podfile` file: /Users/Kyle/Desktop/Testing/Podfile:1: no .<digit> floating literal anymore; put 0 before dot
platform :ios, ‘7.0’
                    ^
/Users/Kyle/Desktop/Testing/Podfile:1: syntax error, unexpected tINTEGER, expecting '('
platform :ios, ‘7.0’
                     ^. Updating CocoaPods might fix the issue.

Everything in the Podfile seems correct. I have tried with " instead of ' with no effect. I have also removed the decimal (the dot) and moved it around. Am I missing something?

After trolling through the web, one user suggested that something might be wrong with my Ruby installation, but how can I check that? I have also verified that I installed all Ruby updates with this:

sudo gem update --system

Any help would be great, thanks!


回答1:


Had this same issue. It's difficult to notice, but if you're on a Mac and used TextEdit to edit the Podfile, the quote character was probably changed. Turn off 'Smart Quotes' in Preferences.




回答2:


I had the same issue the following worked for me. In replace curly quotes in Podfile's first line i.e

platform :ios, ‘7.0’ (Not working)
platform :ios, '7.0' (Working)

You are using curly quotes character, which is ‘=0x2018 & ’=0x2019. You should use straight quote which is '=0x27

TextEdit automatically converts normal quotes to smart quotes. You can disable smart quotes option from : System Preferences -> Keyboard -> uncheck 'Use smart quotes and dashes'



来源:https://stackoverflow.com/questions/21109196/cocoapods-install-getting-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!