Travis-CI error with “eval pod install”

2019-06-06 03:31发布

My .travis.yml file:

language: objective-c

script: 
    xctool -workspace ProjectName.xcworkspace -scheme ProjectName build -sdk iphonesimulator

While Travis-CI is building the project it says:

$ bundle --version
Bundler version 1.7.4
$ xcodebuild -version -sdk
$ pod --version
0.34.4
Installing Pods with 'pod install'
$ pushd .
~/build/GabrielMassana/ProjectName-iOS
$ pod install

While installing pods the error is:

The command "eval pod install" failed. Retrying, 2 of 3.
The command "eval pod install" failed. Retrying, 3 of 3.
The command "eval pod install" failed 3 times.
The command "pod install" failed and exited with 1 during .
Your build has been stopped.

1条回答
疯言疯语
2楼-- · 2019-06-06 03:42

I discovered that adding this lines solves my problem.

before_install:
    - rvm use system
    - sudo gem install cocoapods -v '0.39.0'  

So my final .travis.yml file:

language: objective-c

before_install:
   - rvm use system
   - sudo gem install cocoapods -v '0.39.0'  

script: 
    xctool -workspace ProjectName.xcworkspace -scheme ProjectName build -sdk iphonesimulator

Now cocoapods finish installing.

Probably some Travis machines are set up to run with an old version (0.34.4)

I also wrote a post in my blog about Travis-CI.

查看更多
登录 后发表回答