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
when you get recursion or Ctrl+D doesn't work
you can kill current process ($$)
$$
exec("kill -9 #{$$}")