Virtual-environments: Ruby 2.6.4 support

Created on 31 Aug 2019  路  10Comments  路  Source: actions/virtual-environments

Essentially the same problem as actions/setup-ruby#8.

Since 2.6.4 is a release for security reasons everyone should be able update ASAP, which gives the topic a certain urgency.

Has anyone found a way to install a specific ruby version manually?

Thanks in advance,
Jo

Ruby

Most helpful comment

And now Ruby is up to 2.6.5, Heroku and CircleCI already have updates for it. Should we just assume this setup-ruby action will be out-of-date, and use the docker form of workflows instead?

All 10 comments

Has anyone found a way to install a specific ruby version manually?

I think you can install it however you want, as you can run arbitrary commands (and you are allowed to sudo).

Or you can use Docker. Example using the official images.

name: Ruby

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Build and test with Rake
      run: |
        gem install bundler
        bundle install --jobs 4 --retry 3
        bundle exec rake
    container:
      image: ruby:2.6.4

Too bad 2.6.4 is not supported (even in v1.1.0). Container specification is much longer to build (1m30 vs 30s)

Using rvm with ruby-head takes a bit under 60 seconds, other versions should be similar. Example workflow in ruby/ruby.

Regardless, I would prefer that current versions be pre-installed...

And now Ruby is up to 2.6.5, Heroku and CircleCI already have updates for it. Should we just assume this setup-ruby action will be out-of-date, and use the docker form of workflows instead?

ruby:2.6.4 fetch took 42s. There's no build, it'll just fetch all layers. Quite reasonable.

@ain I am trying to use docker to install ruby:2.6.4, that works great. But after I need to add libpq-dev to be able to use Postgres, I was doing this:

    - name: Install required package for Postgres
      run: |
        sudo apt-get install libpq-dev

But GitHub Actions is not liking it: sudo: not found
I am doing something wrong?

@elalemanyo you don鈥榯 need to use sudo, just leave it off

@clupprich thanks!
Without sudo looks to work, but now I have issues with postgres 馃様
I set postgres service like this:

    services:
      postgres:
        image: postgres:10.8
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: ""
          POSTGRES_DB: postgres
        # needed because the postgres container does not provide a healthcheck
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

After I try to create my DB:

    - name: Build and create DB
      env:
        POSTGRES_HOSTNAME: postgres
        POSTGRES_USER: postgres
        POSTGRES_PORT: 5432
        RAILS_ENV: test
      run: |
        bin/rails db:setup

But I am getting this error:

could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

FWIW https://github.com/eregon/use-ruby-action supports all Ruby 2.6.x versions.

This is done, Windows and Linux runners are now in 2.6.5

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zackijack picture zackijack  路  3Comments

matthewfeickert picture matthewfeickert  路  3Comments

raulpopadineti picture raulpopadineti  路  3Comments

mxschmitt picture mxschmitt  路  3Comments

damccorm picture damccorm  路  3Comments