Podfile不兼容的字符编码:UTF-8和ASCII-8BIT

时间:2016-05-04 08:24:33

标签: jenkins encoding cocoapods

运行pod install时遇到问题。

我使用Jenkins作为CI系统。 当我在我的电脑上本地运行命令它按预期工作。但是当Jenkins运行pod install时,我收到编码错误:

[10:08:33]: ▸ Updating local specs repositories
[10:08:33]: ▸ CocoaPods 1.0.0.rc.1 is available.
[10:08:33]: ▸ To update use: `sudo gem install cocoapods --pre`
[10:08:33]: ▸ [!] This is a test version we'd love you to try.
[10:08:33]: ▸ For more information see http://blog.cocoapods.org
[10:08:33]: ▸ and the CHANGELOG for this version http://git.io/BaH8pQ.
[10:08:33]: ▸ Analyzing dependencies
[10:08:33]: ▸ /Users/********/.rvm/gems/ruby-2.1.5/gems/cocoapods-0.39.0/lib/cocoapods/user_interface/error_report.rb:13:in `report': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
[10:08:33]: ▸ from /Users/********/.rvm/gems/ruby-2.1.5/gems/cocoapods-0.39.0/lib/cocoapods/command.rb:61:in `report_error'
[10:08:33]: ▸ from /Users/********/.rvm/gems/ruby-2.1.5/gems/claide-0.9.1/lib/claide/command.rb:374:in `handle_exception'
[10:08:33]: ▸ from /Users/********/.rvm/gems/ruby-2.1.5/gems/claide-0.9.1/lib/claide/command.rb:315:in `rescue in run'
[10:08:33]: ▸ from /Users/********/.rvm/gems/ruby-2.1.5/gems/claide-0.9.1/lib/claide/command.rb:303:in `run'
[10:08:33]: ▸ from /Users/********/.rvm/gems/ruby-2.1.5/gems/cocoapods-0.39.0/lib/cocoapods/command.rb:47:in `run'
[10:08:33]: ▸ from /Users/********/.rvm/gems/ruby-2.1.5/gems/cocoapods-0.39.0/bin/pod:44:in `<top (required)>'
[10:08:33]: ▸ from /Users/********/.rvm/gems/ruby-2.1.5/bin/pod:23:in `load'
[10:08:33]: ▸ from /Users/********/.rvm/gems/ruby-2.1.5/bin/pod:23:in `<main>'
[10:08:33]: ▸ from /Users/********/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
[10:08:33]: ▸ from /Users/********/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'

我之前在PC上遇到了同样的问题,但是当我删除并重新创建Podfile时,我修复了它。

我看到许多开发人员在输入错误的单引号字符时遇到同样的问题,但它对我来说很好。 这是Podfile:

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, 8.0
inhibit_all_warnings!

xcodeproj 'SkyApp.xcodeproj'

def common_pods
  pod 'Jibber-Framework', '~> 2.0', :configurations => ['Dev-Debug']
  pod 'SVProgressHUD'
  pod 'AFOAuth2Manager', '~> 2.2.0'
  pod 'AFNetworking'
  pod 'ObjectiveLuhn'
  pod 'Bolts'
  pod 'RNCryptor', '3.0.0'
  pod 'SVPullToRefresh',                  :git => 'https://github.com/iOS-stars/SVPullToRefresh', :commit => '16024d81407cf94c8db0ac7cd1013757761ea9fd'
  pod 'CrittercismSDK', '~> 5.5.5'
  # Payment providers
  pod 'Stripe'
  pod 'Braintree'

  # Debugging
  pod 'Reveal-iOS-SDK',    :configurations => ['Dev-Debug']
  pod 'MAObjCRuntime',     :configurations => ['Dev-Debug']
end

def testing_pods
  pod 'Kiwi'
end

target 'SkyApp', :exclusive => true  do
  common_pods
end

target 'SkyApp-cal', :exclusive => true  do
  common_pods
end

target 'SkyAppTests', :exclusive => true do
  testing_pods
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

就我个人而言,我认为它与Jenkins无关,因为它也没有在我的Mac上工作,但我不确定。

0 个答案:

没有答案