-
Notifications
You must be signed in to change notification settings - Fork 14
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
NoMethodError: undefined method '[]' for nil with ruby3.4.0dev #225
Comments
So this is due to ruby3.4 backtrace change: https://github.com/ruby/ruby/blob/e539342f65e468fc7f926277eff61cb8b8a60622/NEWS.md?plain=1#L224-L242 Especially, now single quote is used instead of backtick . puppet-lint/lib/puppet-lint/data.rb Lines 60 to 63 in 167ab94
Extra change is that backtrace now shows class name. A fix for this is something like:
|
https://stackoverflow.com/questions/5100299/how-to-get-the-name-of-the-calling-method suggests a better method is to use caller_locations which returns Location objects which have a label method, avoiding the need to do any regular expression parsing. The same thread mentions it's a Ruby 2 thing, but this Ruby 1 compatibility should have been dropped long ago. Also mentions that |
Using
ruby 3.4.0dev (2024-12-04 master e539342f65) +PRISM [x86_64-linux]
ruby/ruby@e539342
pupplet-lint git head 167ab94
rspec testsuite does not do anything but exits abnormally:
Then explicitly executing testsuite shows backtrace error:
Works normally with
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [x86_64-linux]
The text was updated successfully, but these errors were encountered: