When using irb or rails console, I sometimes get stuck. For example, I forget a closing quote, so when I press enter, it\'s still waiting on that.<
irb
rails console
Press Control + D once or twice. That should do it.
Control + D