-
-
Notifications
You must be signed in to change notification settings - Fork 78
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 3 Bug image_pack_tag "wrong number of arguments (given 2, expected 1)" #312
Comments
Same issue & fix with other helpers like |
I've run into this issue as well when trying to upgrade ro Rails 7 / Ruby 3 Wasn't able to reproduce on 6.1 / Ruby 3 I think this may be related to #268 Probably it is not covered by specs
I've used I18n.t |
I have the same issue with Rails 6.0 / Ruby 3. |
Is there any reproducible test case? Specs are all green against Ruby 3.0: |
I run the tests on my computer and they also worked. Even when I changed some labels to I suspect some problem with Another option would be to drop ruby 2.5 and 2.6 support completely. 2.6 is reaching EOL very soon and Rails 7, which is a dependency inside the Gemfile, is requiring >= 2.7 anyway. |
I'm encountering now the same issue after upgrading to Ruby 3.0. I did get a deprecation warning on Ruby 2.7. It does occur from calling a helper method that accepts kwargs. I will look into adding a failing case in the integration tests soon. |
Yesterday, I was able to get a failing test on Ruby 3.0 through an ActiveAdmin form calling a helper method, just as OP reported. I couldn't figure out how to replicate this on just Arbre's test suite though but having that failure on ActiveAdmin may help establish that how to do that. I'll submit that for ActiveAdmin in the meantime. Worth noting if the helper method takes keyword arguments but they are all optional and none are given, no error occurs on Ruby 3.0 but if any kwargs are specified (required or not), it will fail with the argument error reported. |
When a helper method accepts kwargs and they are given, this causes a failure in Ruby 3.0. > wrong number of arguments (given 2, expected 1) (ActionView::Template::Error) > ./tmp/test_apps/rails_61/app/helpers/time_helper.rb:3:in `format_time' If the keyword arguments are all optional and NOT given, then no error occurs. activeadmin/arbre#312
When a helper method accepts kwargs and they are given, this causes a failure in Ruby 3.0. > wrong number of arguments (given 2, expected 1) (ActionView::Template::Error) > ./tmp/test_apps/rails_61/app/helpers/time_helper.rb:3:in `format_time' If the keyword arguments are all optional and NOT given, then no error occurs. activeadmin/arbre#312
When a helper method accepts kwargs and they are given, this causes a failure in Ruby 3.0. > wrong number of arguments (given 2, expected 1) (ActionView::Template::Error) > ./tmp/test_apps/rails_61/app/helpers/time_helper.rb:3:in `format_time' If the keyword arguments are all optional and NOT given, then no error occurs. activeadmin/arbre#312
Hello
I’m trying to update to ruby 3 and get an error on image_pack_tag only on form on active admin
/usr/local/bundle/gems/webpacker-5.4.2/lib/webpacker/helper.rb:52:in image_pack_tag,
/usr/local/bundle/gems/arbre-1.4.0/lib/arbre/element.rb:182:in method_missing,
/usr/local/bundle/gems/arbre-1.4.0/lib/arbre/rails/forms.rb:37:in method_missing,
...
How to reproduce
Add image_pack_tag with more than one parameter
and go on the creation or edition web page
Example
I found a fix to my case, on method missing in file arbre/rails/forms.rb
Replacing
To
And
to
Ruby 3
Rails 6.1
Active admin 2.9
The text was updated successfully, but these errors were encountered: