Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 2.3 to 2.5 - cannot update RubyGems #441

Closed
2 tasks done
andrykonchin opened this issue Jan 7, 2023 · 7 comments
Closed
2 tasks done

Ruby 2.3 to 2.5 - cannot update RubyGems #441

andrykonchin opened this issue Jan 7, 2023 · 7 comments

Comments

@andrykonchin
Copy link
Member

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

The workflow code or a link to the workflow file

https://github.com/Dynamoid/dynamoid/blob/master/.github/workflows/ci.yml

Link to the log of a failed workflow job, or to a gist with the output

https://github.com/Dynamoid/dynamoid/actions/runs/3864041701/jobs/6586597944

The command and output of the failing step

Updating RubyGems

/opt/hostedtoolcache/Ruby/2.5.9/x64/bin/gem --version
  2.7.6.3
  Default RubyGems version is 2.7.6
  Updating RubyGems to latest version
  /opt/hostedtoolcache/Ruby/2.5.9/x64/bin/gem update --system
  ERROR:  Error installing rubygems-update:
  	There are no versions of rubygems-update (= 3.4.3) compatible with your Ruby & RubyGems
  	rubygems-update requires Ruby version >= 2.6.0. The current ruby version is 2.5.0.
  ERROR:  While executing gem ... (NoMethodError)
      undefined method `version' for nil:NilClass
  Updating rubygems-update
  Took   3.06 seconds

Any other notes?

The last successful build was on Dec 22 - https://github.com/Dynamoid/dynamoid/actions/runs/3757073712/jobs/6383867862

@eregon
Copy link
Member

eregon commented Jan 8, 2023

@deivid-rodriguez Do you know about this?
Is it OK if I assign this to you?

Maybe it's related to gem install bundler on old RubyGems not finding the correct version which matches the required_ruby_version?

@deivid-rodriguez
Copy link
Contributor

deivid-rodriguez commented Jan 8, 2023

Yep, it's the same issue.

When end user specifies rubygems: latest, this action runs gem update --system, and that command suffers from the same issue if the version of RubyGems we're upgrading from is older than 3.2.3. Just like gem install bundler, the issue surfaced as soon as we released a RubyGems version that does not support Ruby 2.3.

Ideally this action would run gem update --system 3.3.26 instead when latest is specified on Ruby 2.3, 2.4, or 2.5, since that's as far as we can go on those rubies.

@eregon
Copy link
Member

eregon commented Jan 8, 2023

@andrykonchin Could you try with rubygems: default? Is there a need for rubygems: latest in that workflow?
I would recommend the same for Bundler, to just use setup-ruby's defaults.
FWIW I found that Dynamoid/dynamoid@073374e introduced the change to use both latest.

@eregon
Copy link
Member

eregon commented Jan 8, 2023

@deivid-rodriguez Thank you for the explanation. Is there a way to gem update --system ~> 3.3.0, so it would pick a potential 3.3.27 etc?

@deivid-rodriguez
Copy link
Contributor

I have no idea so I tried it and it does not seem to work, no.

@andrykonchin
Copy link
Member Author

Thank you 🎆.

Yeah, there is no any need to use the latest RubyGems and Bundler I believe in our case.

@eregon
Copy link
Member

eregon commented Dec 27, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants