更新后无法使用cocoapods

时间:2014-10-15 13:18:51

标签: ios ruby macos gem cocoapods

我在mac OSX 10.9.5上更新了Ruby,Gems和Cocoapods,更新后我无法执行命令

pod install

我从终端

收到以下错误
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/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.34.2/lib/cocoapods/command.rb:61:in `report_error'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:300:in `handle_exception'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:274:in `rescue in run'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:264:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/lib/cocoapods/command.rb:48:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.2/bin/pod:33:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'

我创建了一个包含以下内容的Podfile

platform :ios, ‘7.1’

pod 'AFNetworking', '~> 1.3.3’

Cocoapods在更新前完美运作。任何帮助是极大的赞赏。

2 个答案:

答案 0 :(得分:25)

这个角色&#34; '&#34;与第一行中的cocoapods不兼容。 你应该使用它而不是#34; &#39; &#34 ;.所以你的podfile应该是这样的:

platform :ios, '7.1'
pod 'AFNetworking', '~> 2.4'

答案 1 :(得分:3)

问题是在iOS版本周围使用了错误的引号。确保所有报价都是&#39;而不是'或'。