문제

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?

도움이 되었습니까?

해결책

2 things I can think of off the bat: finish entering the code on the next line, or hit ctl-c and start over.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top