8

A standard rails console on a long running rails project has always worked fine on macOS. Recently switched to Ubuntu 18.04, and the rails console in bash and gnome-terminal will always append a \r at the end of every line like so:

Loading development environment (Rails 4.2.8)
irb(main):001:0> \r
irb(main):002:0> \r
irb(main):003:0> User.count\r
   (1.5ms)  SELECT COUNT(*) FROM "users"
=> 3
irb(main):004:0> 

This new behavior also affects scrolling up/down through previous commands, where it will not correctly clear a command and append the previous command after a command.

The .bashrc is the default, with no changes, and default gnome-terminal. (Tested removing changes and issue still appears).

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
P. Q.
  • 191
  • 5
  • 1
    I'm having the same issue on a Rails 5.0.1 project. Recently upgraded to Ubuntu 18.04 too. What is weird is that it only happens for one of my projects. My other projects are all using Rails 5.1, not sure if that is the reason. I also tried with different ruby versions (2.4.1 and 3.1). I'm using zsh with zpresto – mcelicalderon Jun 06 '18 at 00:47

1 Answers1

11

I figured it out eventually:

bundle update rb-readline

And the problem goes away!

P. Q.
  • 191
  • 5