Ruby console input halting at 1024 characters

后端 未结 1 980
清酒与你
清酒与你 2021-01-21 10:03

I have a script that takes console input into a variable and requires pasting in a string longer than 1024 characters.

When I try to paste more than 1024 characters it s

相关标签:
1条回答
  • 2021-01-21 10:07

    Try this:

    gem install rb-readline
    

    In your script:

    require 'rb-readline'
    

    and then, to read a line:

    a = Readline::readline
    

    Does that solve it?

    If so, you may also want to look at compiling your Ruby with readline:

    https://github.com/guard/guard/wiki/Add-Readline-support-to-Ruby-on-Mac-OS-X

    0 讨论(0)
提交回复
热议问题