可可豆荚不兼容的字符编码,安装 RestKit 时



嗨,我是cocoaPods的新手,这是我第一次尝试设置它,我试图将RestKit添加到我的项目中,但是当我运行pod install时,我得到如下所示的错误。

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.36.4/lib/cocoapods/user_interface/error_report.rb:13:in `report': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.36.4/lib/cocoapods/command.rb:59:in `report_error'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:374:in `handle_exception'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:315:in `rescue in run'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:303:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.36.4/lib/cocoapods/command.rb:46:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.36.4/bin/pod:44:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'

对此仍然很陌生,所以我不确定我在哪里出错了,我在网上检查并发现了类似的问题,但没有一个问题解决。我在终端中的所有命令都在下面,以显示我到目前为止所做的工作,我认为我正确设置了可可豆荚,问题出在 pod 文件上,但我不确定。此外,pod 文件的内容如下。感谢您的任何帮助。

终端:

CocoaPods 0.37.0.rc.1 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Setup completed
Some-MacBook-Pro:Articles Some$ touch podfile
Some-MacBook-Pro:Articles Some$ open -a TextEdit PodFile
Some-MacBook-Pro:Articles Some$ pod install
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.36.4/lib/cocoapods/user_interface/error_report.rb:13:in `report': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.36.4/lib/cocoapods/command.rb:59:in `report_error'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:374:in `handle_exception'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:315:in `rescue in run'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:303:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.36.4/lib/cocoapods/command.rb:46:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.36.4/bin/pod:44:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'
Some-MacBook-Pro:Articles Some$ open a- TextEdit PodFile
The files /Users/Some/Desktop/RW-Tutorials/Articles/a- and /Users/Some/Desktop/RW-Tutorials/Articles/TextEdit do not exist.
Some-MacBook-Pro:Articles Some$ 

豆荚文件:

platform :iOS, ‘8.0’
pod ‘RestKit’, ’~> 0.20.0’

重新格式化为 '

复制/粘贴下面的"to"示例或退格并手动键入'

platform :iOS, ‘8.0’
pod ‘RestKit’, ’~> 0.20.0’

platform :iOS, '8.0'
pod 'RestKit', '~> 0.20.0'

然后运行容器安装/更新

终端 并键入以下命令:

sudo gem update --system

接下来,您需要安装 CocoaPods。在终端中键入以下命令:

sudo gem install cocoapods

在终端中输入以下命令以完成 CocoaPod 的设置:

pod setup

打开终端并使用 cd 命令导航到包含项目的目录:

cd ~/Path/To/Folder/Containing/yourprojectName

接下来输入以下命令:

pod init

键入以下命令以打开 Podfile 进行编辑:

open -a Xcode Podfile

将这些文件添加到容器文件中

platform :iOS, '8.0'
pod 'RestKit', '~> 0.20.0'

然后你需要输入以下内容来完成

pod install

之后,打开项目文件夹上的工作区

最新更新