setup-ruby: Bundler install appears broken on Ruby 2.2

Ensure the following before filing this issue

  • I verified it reproduces with the latest version with - uses: ruby/setup-ruby@v1 (see Versioning policy)

  • I tried to reproduce the issue locally by following the workflow steps (including all commands done by ruby/setup-ruby, except for Downloading Ruby & Extracting Ruby), and it did not reproduce locally (if it does reproduce locally, it’s not a ruby/setup-ruby issue)

Are you running on a GitHub-hosted runner or a self-hosted runner?

GitHub-hosted runner

Link to the failed workflow job (must be a public workflow job, so the necessary information is available)

https://github.com/jeremyevans/ruby-refrigerator/actions/runs/4716774683/jobs/8364821711

Any other notes?

This has failed in multiple projects, and appears to be a general issue with Ruby 2.2. Here’s another example: https://github.com/jeremyevans/sequel/actions/runs/4723218962/jobs/8378878032

Installation of bundler works locals:

$ gem22 install bundler -v '~> 1.0'
Fetching: bundler-1.17.3.gem (100%)
Successfully installed bundler-1.17.3
1 gem installed
$ ruby22 -v
ruby 2.2.10p489 (2018-03-28 revision 63023) [x86_64-openbsd]
$ gem22 -v
2.4.5.5

Example output:

Installing Bundler
  Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2
  /opt/hostedtoolcache/Ruby/2.2.10/x64/bin/gem install bundler -v ~> 1.0
  ERROR:  While executing gem ... (RuntimeError)
      Marshal.load reentered at marshal_load
  Took   0.36 seconds

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 3
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

This is possibly related to the deprecation of the RubyGems dependencies API. There’s a brownout today (2023-04-17). See https://blog.rubygems.org/2023/02/22/dependency-api-deprecation.html and https://blog.rubygems.org/2023/04/07/dependency-api-deprecation-delayed.html.

Ruby 2.1 has also been encountering issues (see #493).

There is no workaround for Ruby 2.2 and Ubuntu 22.04 and this action. Try using old Docker images instead: https://hub.docker.com/_/ruby/tags?page=1&name=2.2&ordering=-last_updated

So from the above runs it seems to always work on 20.04, and always fail on 22.04. So a simple workaround for now is using ubuntu 20.04 for such old Rubies (and when 20.04 is removed there will be no way to get Ruby 2.2 to run on a GitHub-hosted Linux runner probably).