ruby / rake

A make-like build utility for Ruby.

Home Page:https://ruby.github.io/rake

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined method `=~` in Ruby 3.2

tilo opened this issue · comments

commented

This line:

opt.select { |o| o.is_a?(String) && o =~ /^-/ }.map(&:downcase).sort.reverse

is causing this error when running against Ruby 3.2 or head

Run bundle exec rake test
rake aborted!
NoMethodError: undefined method `=~' for #<Proc:0x00007f91a0e28540 /home/runner/work/smarter_csv/smarter_csv/vendor/bundle/ruby/3.2.0+1/gems/rake-10.5.0/lib/rake/application.rb:393 (lambda)>
/opt/hostedtoolcache/Ruby/3.2.0-preview1/x64/bin/bundle:25:in `load'
/opt/hostedtoolcache/Ruby/3.2.0-preview1/x64/bin/bundle:25:in `<main>'
(See full trace by running task with --trace)
Error: Process completed with exit code 1.

@tilo With the current Ruby 3.2.0dev ruby/ruby@56cc3e9, it looks like no error according to the latest build.

https://github.com/ruby/rake/runs/6872931931?check_suite_focus=true

/home/runner/.rubies/ruby-head/bin/ruby --version
  ruby 3.2.0dev (2022-06-13T17:11:27Z master 56cc3e99b6) [x86_64-linux]

Can you try the latest Ruby 3.2 head to reproduce?

I was running into the same error and tried to reproduce it. In the end I just saw the error with rake 11, but was unable to repro with the current rake. I assume you'll be able to fix the problem by bumping rake to the most current version which appears to support ruby 3.2 just fine.