rubocop: Error on Ruby 2.7: undefined method `on_numblock' for #
rubocop myfile.rb
Inspecting 1 file
.
0 files inspected, no offenses detected
undefined method `on_numblock' for #<RuboCop::Cop::Commissioner:0x00007fe520ae4310>
Did you mean? on_block
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/ast/traversal.rb:50:in `block in on_begin'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/ast/traversal.rb:50:in `each'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/ast/traversal.rb:50:in `on_begin'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cop/commissioner.rb:33:in `block (2 levels) in <class:Commissioner>'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/ast/traversal.rb:100:in `on_def'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cop/commissioner.rb:33:in `block (2 levels) in <class:Commissioner>'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/ast/traversal.rb:50:in `block in on_begin'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/ast/traversal.rb:50:in `each'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/ast/traversal.rb:50:in `on_begin'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cop/commissioner.rb:33:in `block (2 levels) in <class:Commissioner>'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/ast/traversal.rb:13:in `walk'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cop/commissioner.rb:44:in `investigate'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cop/team.rb:124:in `investigate'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cop/team.rb:112:in `offenses'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cop/team.rb:44:in `inspect_file'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:296:in `inspect_file'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:244:in `block in do_inspection_loop'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:276:in `block in iterate_until_no_changes'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:269:in `loop'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:269:in `iterate_until_no_changes'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:240:in `do_inspection_loop'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:119:in `block in file_offenses'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:143:in `file_offense_cache'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:117:in `file_offenses'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:108:in `process_file'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:87:in `block in each_inspected_file'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:86:in `each'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:86:in `reduce'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:86:in `each_inspected_file'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:73:in `inspect_files'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/runner.rb:39:in `run'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cli/command/execute_runner.rb:21:in `execute_runner'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cli/command/execute_runner.rb:13:in `run'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cli/command.rb:10:in `run'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cli/environment.rb:17:in `run'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cli.rb:65:in `run_command'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cli.rb:72:in `execute_runners'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/lib/rubocop/cli.rb:41:in `run'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/exe/rubocop:13:in `block in <top (required)>'
/Users/chris/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/benchmark.rb:308:in `realtime'
/Users/chris/.rvm/gems/ruby-2.7.0/gems/rubocop-0.78.0/exe/rubocop:12:in `<top (required)>'
/Users/chris/.rvm/gems/ruby-2.7.0/bin/rubocop:23:in `load'
/Users/chris/.rvm/gems/ruby-2.7.0/bin/rubocop:23:in `<main>'
My env: Ruby 2.7.0 Mac OS 10.15.2 Rubocop: 0.78.0
Tried ruby 2.6.5 with same rubocop verison and was working fine.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (10 by maintainers)
@ChrisZou Parser 2.7.0.1 is not the only part of the solution; some changes have been made to the
masterbranch to start supporting the Ruby 2.7 syntax. Use themasterversion or wait for the next release.The PR was just merged.
@koic @buehmann Are any of you already working on this? If not I will work on it tonight. 🙂
Edit: That’s Singapore time, so “tonight” means in two hours. 😬