inf-ruby
inf-ruby copied to clipboard
inf-ruby-get-old-input: Search failed:
Any tips on how to fix my Rails repl is greatly appreciated.
I've been using inf-ruby for a long time but something broke after I reinstalled my OS. The issue is that I can't execute any command by typing it and pressing Enter.
I mean, typing works but Enter doesn't execute it.
I've tried various ways of using ruby-send-*, same result.
When I'm in repl buffer and I press Enter(or execute comint-send-input), the following message is printed in Messages buffer
inf-ruby-get-old-input: Search failed: "\(^>> *\)\|\(^(rdb:1) \)\|\(^(byebug) \)\|\(^\(irb([^)]+)\|\([[0-9]+] \)?[Pp]ry ?([^)]+)\|\(jruby-\|JRUBY-\)?[1-9]\.[0-9]\(\.[0-9]+\)\(-?p?[0-9]+\)?\|^rbx-head\) ?[0-9:] ?> *\)" evil-line-move: End of buffer
Just in case, rails/irb console works fine in the regular/detached "bundle exec rails c" kind of shell.
Ruby version: 3.0.2
-- 7 mins later update: It doesn't seem to be related to the Ruby version. Exactly the same result w/ 2.7.5
-- 35 mins later update: .irbrc(or .railsrc) files didn't exist when I experienced this issue.
I've tried the following .irbrc config from this manual and inf-ruby works great again.
IRB.conf[:USE_MULTILINE] = nil
IRB.conf[:USE_SINGLELINE] = false
IRB.conf[:PROMPT_MODE] = :INF_RUBY
IRB.conf[:USE_READLINE] = false
IRB.conf[:USE_COLORIZE] = true
Sounds good. Though I think you might get away with only using one or two of these statements (probably multiline; colorize and prompt mode -- might not be required).
How do you launch the rains console, BTW?
Is it M-x inf-ruby
or M-x inf-ruby-console-auto
?
From what I see, missing .irbrc breaks both(inf-ruby
and inf-ruby-console-auto
) for me - can type commands but can't execute them(no Enter/comint-send-input)
Though I think you might get away with only using one or two of these statements
- I've tried .irbrc w/ the following line: IRB.conf[:USE_MULTILINE] = nil
it didn't work.
- just the following line IRB.conf[:USE_SINGLELINE] = false
worked fine
- or just IRB.conf[:PROMPT_MODE] = :INF_RUBY
worked too.
HTH
IRB.conf[:USE_MULTILINE] = nil
Perhaps
IRB.conf[:USE_MULTILINE] = false
would work?
and inf-ruby-console-auto
Hm, okay. Which version of Rails are you using? Like a comment in inf-ruby-console-rails
's definition says, our workaround is supposed to work in Rails > 5.1.4.
Rails version 6.1.4.1
OK this is embarrassing, now it works even without ~/.irbrc file. I'm sorry for this unreliable bug report. If I find something relevant, I'll post it in this thread.
Or let me know if you need some kind of additional info.
Perhaps there was some scenario where this doesn't work. I'd still like to hear about it.
Maybe you didn't have inf-ruby
at the latest version. Or maybe launching through inf-ruby-console-rails
is different than through inf-ruby-console-auto
? Though it shouldn't be.
Thanks.
@dgutov sorry for the delay. I'll post some more info whenever I find some free time
Let me know if you see this again.