简体   繁体   English

如何为 Xcode 项目升级 Circle CI 2.0 上的 ruby​​ 版本?

[英]How can I upgrade ruby version on Circle CI 2.0 for Xcode projects?

I sat the config.yml and .ruby-version to upgrade ruby.我坐在 config.yml 和 .ruby-version 来升级 ruby​​。

But I got an error message unknown Ruby: ruby-2.6.2但我收到一条错误消息unknown Ruby: ruby-2.6.2

It used the ruby-2.3, and It has no problems.它使用了 ruby​​-2.3,它没有问题。

How can I set ruby 2.6.2 with config.yml?如何使用 config.yml 设置 ruby​​ 2.6.2?

config.yml配置文件

defaults: &defaults
    macos:
      xcode: "10.0"
    shell: /bin/bash --login -eo pipefail
aliases:
  - &prepare
    | 
      git submodule update --init --recursive
      gem install bundler
      bundle install
  - &filter-only-master
    branches:
      only:
        - master

version: 2
jobs:
  ios:
    <<: *defaults
    steps:
      - checkout
      - run: *prepare
      - run: bundle exec rake test:ios
      - run: bash <(curl -s https://codecov.io/bash)
      - store_test_results:
          path: build/reports
  macos:
    <<: *defaults
    steps:
      - checkout
      - run: *prepare
      - run: bundle exec rake test:macos
      - run: bash <(curl -s https://codecov.io/bash)
      - store_test_results:
          path: build/reports
  facebook_utils:
    <<: *defaults
    steps:
      - checkout
      - run: *prepare
      - run: bundle exec rake test:facebook_utils:ios
      - run: bash <(curl -s https://codecov.io/bash)
      - store_test_results:
          path: build/reports
  twitter_utils:
    <<: *defaults
    steps:
      - checkout
      - run: *prepare
      - run: bundle exec rake test:twitter_utils:ios
      - run: bash <(curl -s https://codecov.io/bash)
      - store_test_results:
          path: build/reports
  parseui:
    <<: *defaults
    steps:
      - checkout
      - run: *prepare
      - run: bundle exec rake test:parseui:all
  deployment:
    <<: *defaults
    steps:
      - checkout
      - run: *prepare
      - run: |
            xcrun simctl create "Apple TV 1080p" com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p com.apple.CoreSimulator.SimRuntime.tvOS-11-0
            bundle exec rake package:release
  jazzy:
    <<: *defaults
    steps:
      - checkout
      - run: *prepare
      - run: ./Scripts/jazzy.sh
  carthage:
    <<: *defaults
    steps:
      - checkout
      - run: *prepare
      - run: bundle exec rake test:carthage
  cocoapods:
    <<: *defaults
    steps:
      - checkout
      - run: *prepare
      - run: bundle exec rake test:cocoapods

workflows:
  version: 2
  pr:
    jobs:
      - ios
      - macos
      - facebook_utils
      - twitter_utils
      - parseui
      - jazzy
  nightly:
    jobs:
      - deployment
      - cocoapods:
          requires:
            - deployment
      - carthage:
          requires:
            - deployment
    triggers:
      - schedule:
          cron: "0 1 * * *"
          filters: *filter-only-master

.ruby-version .ruby 版本

ruby-2.6.2

I get an error message below我在下面收到一条错误消息

#!/bin/bash --login -eo pipefail
git submodule update --init --recursive
gem install bundler
bundle install
^D^Dchruby: unknown Ruby: ruby-2.6.2
Exited with code 1

In CircleCI 2.0 you need to check which ruby versions are installed for the specific macOS container image that you are building with.在 CircleCI 2.0 中,您需要检查为您正在构建的特定macOS 容器映像安装了哪些 ruby​​ 版本。

Our macOS containers contain multiple versions of Ruby.我们的 macOS 容器包含多个版本的 Ruby。 The default version is the system-installed Ruby.默认版本是系统安装的 Ruby。 The containers also include the latest stable versions of Ruby at the time that the container is built.容器还包括构建容器时最新的稳定版 Ruby。 We determine the stable versions of Ruby using the Ruby-Lang.org downloads page.我们使用 Ruby-Lang.org 下载页面来确定 Ruby 的稳定版本。 The version of Ruby that are installed in each image are listed in the software manifests of each container.每个镜像中安装的 Ruby 版本列在每个容器的软件清单中。 https://circleci.com/docs/2.0/testing-ios/#using-custom-ruby-versions https://circleci.com/docs/2.0/testing-ios/#using-custom-ruby-versions

Since you are building in Xcode 10. The macOS container image 10.0.0: Xcode 10.0 (Build 10A255) , ruby versions 2.3.7, 2.4.4, 2.5.1 are available to chruby.由于您在 Xcode 10 中构建。macOS容器映像10.0.0: Xcode 10.0 (Build 10A255) ,ruby 版本 2.3.7、2.4.4、2.5.1 可用于 chruby。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM