# "\[latest\] is an invalid version of Crystal" even though it \_is\_ valid

**URL:** <https://travis-ci.community/t/latest-is-an-invalid-version-of-crystal-even-though-it-is-valid/4663>\
**Category:** Crystal\
**Tags:** travis-build\
**Created:** [August 9, 2019, 6:01pm UTC](https://travis-ci.community/t/latest-is-an-invalid-version-of-crystal-even-though-it-is-valid/4663 "2019-08-09T18:01:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leon7](https://avatars.discourse-cdn.com/v4/letter/l/8edcca/32.png) [@leon7](https://travis-ci.community/u/leon7)\
**Post date:** [August 9, 2019, 6:01pm UTC](https://travis-ci.community/t/latest-is-an-invalid-version-of-crystal-even-though-it-is-valid/4663/1 "2019-08-09T18:01:23Z")

</div>

I get the following error message when trying to build an application in multiple stages:

```auto
Installing Crystal
[latest] is an invalid version of Crystal.
View valid versions of Crystal at https://docs.travis-ci.com/user/languages/crystal/

```

Relevant `.travis.yml` file:

```auto
dist: bionic

jobs:
  include:
    - stage: build
      language: crystal
      crystal:
        - latest
      before_install:
        - shards update
        - shards install
      install:
        - crystal build --error-on-warnings src/invidious.cr
      script:
        - crystal tool format --check
        - crystal spec

    - stage: build_docker
      services:
        - docker
      install:
        - docker-compose build

```

Works fine when the version specification is moved outside the build stage to the root right next to `dist: bionic`.

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [August 9, 2019, 7:58pm UTC](https://travis-ci.community/t/latest-is-an-invalid-version-of-crystal-even-though-it-is-valid/4663/2 "2019-08-09T19:58:29Z")

</div>

You need `crystal: latest` instead. (Though we should just take the first value of the array instead, as we do with other languages.)

---

<div class="post-metadata">

**Author:** ![leon7](https://avatars.discourse-cdn.com/v4/letter/l/8edcca/32.png) [@leon7](https://travis-ci.community/u/leon7)\
**Post date:** [August 10, 2019, 7:53am UTC](https://travis-ci.community/t/latest-is-an-invalid-version-of-crystal-even-though-it-is-valid/4663/3 "2019-08-10T07:53:26Z")

</div>

Thanks, @BanzaiMan, `crystal: latest` works fine, but what if we need to test on `latest` and `nightly`? Will the yaml-array-style work when multiple entries are specified?

Is the community support for `crystal` open source? I’d love to see how it is implemented.

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [August 10, 2019, 1:46pm UTC](https://travis-ci.community/t/latest-is-an-invalid-version-of-crystal-even-though-it-is-valid/4663/4 "2019-08-10T13:46:11Z")

</div>

> [@leon7](#):
>
> what if we need to test on `latest` and `nightly` ? Will the yaml-array-style work when multiple entries are specified?

Please read [Building a Crystal Project - Travis CI](https://docs.travis-ci.com/user/languages/crystal#configuration-options)

Your configuration is invalid because you specify `crystal: [latest]` in an element of `jobs.include`.

---

<div class="post-metadata">

**Author:** ![leon7](https://avatars.discourse-cdn.com/v4/letter/l/8edcca/32.png) [@leon7](https://travis-ci.community/u/leon7)\
**Post date:** [August 10, 2019, 1:59pm UTC](https://travis-ci.community/t/latest-is-an-invalid-version-of-crystal-even-though-it-is-valid/4663/5 "2019-08-10T13:59:49Z")

</div>

I don’t know how to proceed. How to test on `latest` and `nightly` using `jobs.include` then?
