Closed lazyatom closed 9 months ago
I have updated the description with some comments that I think more clearly identify the situation where this issue occurs -- it's nothing to do with Rails, and only occurs when the compiled Readline library cannot be loaded. This is the default case on a new Ruby 3.3 installation, because the readline-ext
gem is no longer included by default.
thanks!
Update -- I believe this error has nothing to do with Rails, but was exposed because my version of Ruby 3.3 did not have readline built properly. When readline could not be loaded, it falls back to the code which calls
gets
, and if there is a filename in ARGV, it will try to load that file as input tordbg
. I think the fix remains -- it's the same as https://github.com/ruby/debug/issues/156A simple way to replicate it would be to move
readline.so
out of the way in your local ruby installation, and then with the programm intest.rb
:then run this ensuring there's a file path in ARGV, e.g.
ruby test.rb
. This should hit the error.Further update -- I think this may ultimately be because the
readline-ext
gem is no longer bundled as of Ruby 3.3 (https://bugs.ruby-lang.org/issues/19616); this means that by default,readline.so
(orreadline.bundle
) will not load, and we will hit this code path.Original report message:
Under Ruby 3.3, without this change, running tests under Rails (7.1.3) using the
bin/rails test
command fails.Either way, making this change seems to fix it. The error is very reminiscent of that described in https://github.com/ruby/debug/issues/156, where a similar fix was required.
I apologise but I am not sure how to express this failure in a test, but I can confirm that the build does not fail under Ruby 3.3 either with or without my proposed change.
I should say that I'm running this on an M1 Pro processor, and I have a colleague using an Intel mac who cannot replicate this, so perhaps that's involveD?
The failure can be expressed in two ways. If a whole test file is being run (e.g.
bin/rails test test/models/thing_test.rb
, then it looks like the whole contents of the file are being passed to rdbg:If a specific line is passed (e.g.
bin/rails test test/models/thing.rb:4
), then the failure is different: