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

Warning: Using the last argument as keyword parameters is deprecated #38202

Closed
wellington1993 opened this issue Jan 9, 2020 · 2 comments
Closed

Comments

@wellington1993
Copy link

@wellington1993 wellington1993 commented Jan 9, 2020

Steps to reproduce

  • Install latest Ruby 2.7 from Rbenv
  • Try to use rails s
  • Error on activesupport-6.0.2.1

Expected behavior

No errors or deprecation messages.

Actual behavior

Warnings:

/home/wellington/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.2.1/lib/active_support/option_merger.rb:24: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/wellington/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.2.1/lib/active_support/core_ext/class/attribute.rb:87: warning: The called method `class_attribute' is defined here
  • warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call from activesupport-6.0.2.1/lib/active_support/option_merger.rb:24
  • warning: The called method class_attribute is defined here from activesupport-6.0.2.1/lib/active_support/core_ext/class/attribute.rb:87

System configuration

Rails version:
Rails 6.0.2.1

Ruby version:
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]

Other problems

/home/wellington/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actionpack-6.0.2.1/lib/action_dispatch/middleware/stack.rb:37: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/wellington/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actionpack-6.0.2.1/lib/action_dispatch/middleware/static.rb:110: warning: The called method `initialize' is defined here
  • warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call from actionpack-6.0.2.1/lib/action_dispatch/middleware/stack.rb:37
  • warning: The called method initialize is defined here from actionpack-6.0.2.1/lib/action_dispatch/middleware/static.rb:110

Thanks!

@wellington1993 wellington1993 changed the title warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call warning: Using the last argument as keyword parameters is deprecated Jan 9, 2020
@wellington1993 wellington1993 changed the title warning: Using the last argument as keyword parameters is deprecated Warning: Using the last argument as keyword parameters is deprecated Jan 9, 2020
@joshmn

This comment has been minimized.

Copy link
Contributor

@joshmn joshmn commented Jan 9, 2020

It's just a warning. It's on the radar of plenty and won't cause any side effects to your application. There are a few branches that are tackling this as well: rm-fix-kwargs-warning-actionmailbox-using-r2_kw and rm-fix-kwargs-warning-actionmailbox :)

@CurtisMorice

This comment has been minimized.

Copy link

@CurtisMorice CurtisMorice commented Mar 24, 2020

follow this guide https://piechowski.io/post/last-arg-keyword-deprecated-ruby-2-7/
and add ** to the def() in youractionpack-6.0.2.1/lib/action_dispatch/middleware/stack.rb:37:
where it is pointing.
like this

    def initialize(**args)
      @middlewares = []
      yield(self) if block_given?
    end

I added the extra * to the args and the error went away... Why? It explains in the url .. GL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.