padrino / padrino-framework

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

ArgumentError at /admin/sessions/new #2245

Open dot-richard opened 3 years ago

dot-richard commented 3 years ago

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

bug

What is the current behavior?

I try "blog tutorial" to get started with padrino (https://padrinorb.com/guides/getting-started/blog-tutorial/) I generate the project padrino g project blog-tutorial -t rspec -e haml -c scss -s jquery -d sequel -b I generate admin padrino g admin I visit "/admin": ArgumentError at /admin/sessions/new wrong number of arguments (given 2, expected 0..1) file: i18n.rb location: translate line: 196 _C:/Users/.../blog-tutorial/admin/views/sessions/new.haml in __tilt37500

Maybe the "pat()" method ?

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

Microsoft Windows 10 Professionnel ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x64-mingw32] Padrino v. 0.15.1 sinatra (2.1.0) i18n (1.8.10) puma (5.5.2) rake, version 13.0.6

I dont know if this work in previous versions, it is my first time on padrino.

jaydorsey commented 3 years ago

Ruby 3.x changes the behavior of keyword arguments. I suspect this is the root cause of the error.

You can see this similarly reported for rails 5

I confirmed that downgrading to ruby 2.7.3 fixes this problem, so this is the likely cause (seems like a padrino bug edit: with ruby 3.x compatibility. or maybe sinatra)

dot-richard commented 3 years ago

Thanks, I've downgraded to ruby 2.6.8 and it work. It was the keyword arguments behavior.

jinshen-cn commented 2 years ago

Will padrino be updated to work with ruby 3.0?

nesquena commented 2 years ago

Will padrino be updated to work with ruby 3.0?

To be candid I don't know if it's fair to say we have any active developers on Padrino at this point. But I'm here to merge PRs and release versions for as long as people still want them!

I myself still use Padrino on some projects but I am keeping all of those on Ruby 2.X. However it would be great if we had a version I could release that worked for recent versions of 2 and 3.

jinshen-cn commented 2 years ago

I did a minor change to fix it. Thanks, @nesquena for merging my PR on this.