2 things I can think of off the bat: finish entering the code on the next line, or hit ctl-c and start over.
Entering IRB line prematurely into Terminal.. How to Resolve?
문제
I am just picking up ruby and wanted to input a command into terminal put pushed the return key by accident before line was not finished.
irb(main):007:0> mixed = {1 => ['a', 'b', 'c'],
irb(main):008:1*
of course now i get "stuck" in the 008.1 of the irb...
How do I go back and edit the code?
해결책
다른 팁
Ruby is generally flexible regarding newlines appearing in your code. In your case you can continue your code on the next line (and eventually end it with }
).
If you would rather correct the line, either give it the input it's waiting for (}
in your case) and get a syntax error or press ctrl+c to interrupt. After doing so, you can press ↑ to edit the line and fix the mistake you made.
제휴하지 않습니다 StackOverflow