gemstash: incombatible with Ruby-3 / later gem versions (wrong number of arguments)

Hi,

just to make the report reproducible, I’m using a docker file. This dockerfile works (with ruby-2.7):

FROM ruby:2-alpine

RUN apk add --update --upgrade --no-cache --virtual .build-dependencies gcc musl-dev make sqlite-dev &&
gem install gemstash &&
apk del .build-dependencies &&
rm -rf /var/cache/apk/*

CMD [“gemstash”,“start”,“–no-daemonize”]

But when replacing the FROM image with ruby:alpine (i.e. using ruby 3) it still compiles,yet the process results in

/usr/local/bundle/gems/gemstash-2.1.0/lib/gemstash/web.rb:10:in initialize': wrong number of arguments (given 1, expected 0) (ArgumentError) from /usr/local/bundle/gems/sinatra-2.1.0/lib/sinatra/base.rb:1527:in new’ […]

regards

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (14 by maintainers)

Commits related to this issue

Most upvoted comments

I can help make the PR if this is the conclusion 😃

One workaround is to give up keyword arguments. I made the changes by the following diff and it eventually works in Ruby 3.

Should we make that move, using that change, and add Ruby 3 to the build matrix?

I don’t know if we should. We don’t even know when Sinatra would fully support Ruby 3. Besides, this might also be a breaking change depends on whether we consider Gemstash::Web as an internal class or not.

I have another proposal, maybe we can make it compatible by supporting both sequence arguments and keyword arguments.

Just like how ERB and Psych do:

If we don’t think it’s a breaking change, then I think applying the change I showed above would be OK.