Skip to content

undefined method =~ in Ruby 3.2 #431

Description

@tilo

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.

Activity

  1. tnir commented on Jun 14, 2022

    @tnir
    Contributor

    @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?

  2. hanneskaeufler commented on Dec 30, 2022

    @hanneskaeufler
    Contributor

    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.

  3. added a commit that references this issue on Feb 21, 2023
  4. elliterate commented on Nov 23, 2024

    @elliterate

    This was fixed by #297.

  5. added a commit that references this issue on Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions