如何在 Travis CI 中配置 CocoaPods? (多语言项目)

How to configure CocoaPods in Travis CI? (multi-language project)

我正在尝试让 Travis CI 在多语言项目上进行设置。 (这个 PR。)我遇到的问题是 pod install 步骤不断出现段错误。

/Users/travis/.rvm/gems/ruby-2.0.0-p643/gems/json-1.8.3/lib/json/ext/parser.bundle: [BUG] Segmentation fault ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]

如果我按照 common Travis build problems 指南中的建议使用 Ruby 1.9.3(通过使用 language: ruby 并在 .travis.yml 中设置 rvm: 1.9.3),那么我在尝试安装 CocoaPods 时遇到错误。

++gem install cocoapods -v 0.32.1 ... ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension. /Users/travis/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -rubygems /Users/travis/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/bin/rake RUBYARCHDIR=/Users/travis/.rvm/gems/ruby-1.9.3-p551/extensions/x86_64-darwin-15/1.9.1/xcodeproj-0.16.1 RUBYLIBDIR=/Users/travis/.rvm/gems/ruby-1.9.3-p551/extensions/x86_64-darwin-15/1.9.1/xcodeproj-0.16.1 /Users/travis/.rvm/rubies/ruby-1.9.3-p551/bin/ruby extconf.rb checking for -std=c99 option to compiler... yes checking for CoreFoundation... no checking for main() in -lCoreFoundation... no CoreFoundation is needed to build the Xcodeproj C extension. *** extconf.rb failed ***

通过设置 rvm: 2.2.3 将 Ruby 的版本更改为 2.2.3 解决了我的问题。