Actions
Bug #19065
closedruby 3.1.2 is printing all class variables for undefined error
Description
Not sure whether this is a bug or some config issue from my side
Files
Updated by mame (Yusuke Endoh) about 2 years ago
- Status changed from Open to Feedback
We need how to reproduce the issue and error output at least.
Updated by Varun (Sai Varun) about 2 years ago
- File checking_rb2.png checking_rb2.png added
- File checking_rb1.png checking_rb1.png added
My bad
I have used the command "ruby script"
In the error message, we are getting all the class variables printed
We load a few files into the class variables and this issue is causing a bit of trouble for us.
Please check it once
Updated by mame (Yusuke Endoh) about 2 years ago
- Is duplicate of Feature #18285: NoMethodError#message uses a lot of CPU/is really expensive to call added
Updated by mame (Yusuke Endoh) about 2 years ago
- Status changed from Feedback to Closed
I think this is a duplicate of #18285.
Since Ruby 3.0.0, an error message of UndefinedMethod always includes all instance variables. As this could be too long as you said, it is reconsidered in #18285.
$ ./bin/ruby-2.7.6 -e 'class Foo; def initialize; @aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1; end; end; Foo.new.boo'
Traceback (most recent call last):
-e:1:in `<main>': undefined method `boo' for #<Foo:0x000055f12b8e94b0> (NoMethodError)
$ ./bin/ruby-3.0.0 -e 'class Foo; def initialize; @aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1; end; end; Foo.new.boo'
-e:1:in `<main>': undefined method `boo' for #<Foo:0x0000559d6e0b5de0 @aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=1> (NoMethodError)
Updated by Varun (Sai Varun) about 2 years ago
Ok thanks for the info
Actions
Like0
Like0Like0Like0Like0Like0