padrino / padrino-framework

Padrino is a full-stack ruby framework built upon Sinatra.
http://www.padrinorb.com
MIT License
3.37k stars 508 forks source link

Padrino fails to start (invoking Regexp.new() syntax error) in padrino-core-0.15.3 with Ruby 3.3.0, OK on Ruby 3.2. #2278

Closed testwisely closed 9 months ago

testwisely commented 10 months ago

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?

Failed to start the app with the following stack trace.

! Unable to load application: ArgumentError: wrong number of arguments (given 3, expected 1..2) /Users/zhimin/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/padrino-core-0.15.3/lib/padrino-core/router.rb:61:in `initialize': wrong number of arguments (given 3, expected 1..2) (ArgumentError)

  match = Regexp.new("^#{Regexp.quote(path).gsub('/', '/+')}(.*)", nil, 'n')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
from /Users/zhimin/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/padrino-core-0.15.3/lib/padrino-core/router.rb:61:in `new'
from /Users/zhimin/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/padrino-core-0.15.3/lib/padrino-core/router.rb:61:in `map'
from /Users/zhimin/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/padrino-core-0.15.3/lib/padrino-core/mounter.rb:116:in `map_onto'
from /Users/zhimin/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/padrino-core-0.15.3/lib/padrino-core.rb:74:in `block in application'
from /Users/zhimin/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/padrino-core-0.15.3/lib/padrino-core.rb:74:in `each'
from /Users/zhimin/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/padrino-core-0.15.3/lib/padrino-core.rb:74:in `application'
from config.ru:14:in `block in <main>'

What is the expected behavior?

No error stacktrace.

Which versions of Ruby, Padrino, Sinatra, Rack, OS are you using? Did this work in previous versions?

Ruby 3.3.0 on Windows and macOS. padrino-core-0.15.3 works fine on previous Ruby versions, including Ruby 3.2.2.

nesquena commented 10 months ago

Thanks for the report, I believe this would be solved with the merge of https://github.com/padrino/padrino-framework/pull/2277 cc @achiurizo

testwisely commented 10 months ago

Wow, such a quick response, thanks. I did browse the outstanding issues first before raising this. Looking forward to the next release.