Error using Pod Install command on Podfile in Terminal
Asked Answered
P

3

35

I have installed Cocoapods, and created a Podfile using Atom containing the following lines:

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

Upon placing this file into my Xcode Project Root Directory, and running 'pod install' in Terminal. The following is shown:

[!] 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>'

I'm unsure what I have done incorrectly, if anyone could give me some advice - it would be really appreciated. Thank you.

Pentastyle answered 5/8, 2015 at 12:28 Comment(0)
B
83

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:

Using TextEdit will give you following,

pod ‘Parse’, ‘~> 1.7.1′    //notice the quotes

To turn off smart quotes in TextEdit, goto

TextEdit > Preferences > New Document > Options

Xcode:

To get the correct quotes you should use Xcode when opening Podfie:

pod 'Parse', '~> 1.7.1'

Terminal Commands to open using Xcode app:

$ touch Podfile  //OR $ cd <parentDirectory of Podfile>
$ open -a Xcode Podfile
Branch answered 5/8, 2015 at 12:48 Comment(3)
'If you are not using TextEdit, you should turn off smart quotes in your editor of choice.' How to do this?Apostrophe
@abhi1992 Which editor are you using? Check preferences of text editor which you are using. if you are using TextEdit, see updated answer.Branch
Strange that no one answered the simple question from @Honey. TextEdit is the default MacOS text editor app, equivalent to Notepad on Windows.Primm
E
4

I had this problem because of using one smart quote in a comment in podfile. I couldn't find a smart quote in my podfile for a while. There are two symbols for smart quotes: ‘ and ’. Make sure both are removed from whole podfile.

    # Espressif’s ESP-TOUCH protocol implements Smart Config ...
Exorcise answered 20/4, 2017 at 12:2 Comment(0)
C
0

Incase someone using Jenkins CI and after correcting the Podfile too error doesnt resolves. Updating your cocoapods version on your slave can help get this error resolved. As jenkins is unable to pinpoint the issue and gives this generic error.

Catawba answered 6/7, 2017 at 7:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.