ruby irb on windows using gitbash shell - can't use arrow keys to modify command input?

房东的猫 提交于 2019-12-10 19:23:23

问题


when I do rails console my git bash shell permits me to use up arrow to recall commands, and use left/right arrows to modify the text I'm entering

when I run irb the shell ignores backspace and arrow keys

I'm not sure why the arrow keys would work fine in the shell for rails console but not when running irb?


回答1:


As I just wrote in the related Backspace and arrow keys aren't working in IRB(Git Bash console) on windows machine:

running irb with --noreadline solved this problem for me:

irb --noreadline



回答2:


What operating system are you running? You may need install the GNU Readline Library and reinstall ruby.




回答3:


Doing the following command fixed the problem for me on Windows

gem install wirble win32console



回答4:


As documented here https://groups.google.com/forum/#!topic/rubyinstaller/HgswOz1T-eE, use the below command/alias:

alias irb="ruby -S irb"


来源:https://stackoverflow.com/questions/6447924/ruby-irb-on-windows-using-gitbash-shell-cant-use-arrow-keys-to-modify-command

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!