Skip to content

Instantly share code, notes, and snippets.

@esteedqueen
Last active September 7, 2023 04:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esteedqueen/15749a7728f4835ad8dacf0f9d33de76 to your computer and use it in GitHub Desktop.
Save esteedqueen/15749a7728f4835ad8dacf0f9d33de76 to your computer and use it in GitHub Desktop.
The curious case of frozen/hanging terminal when you run a`rails g migration` command

Ref: https://stackoverflow.com/questions/24622568/rails-generate-model-hangs

So, I ran into a mysterious situation where running a rails g migration ... command on my terminal freezes/hangs for a really long time.

Running ps aux | grep spring gave me a clue into what was going on.

I got the following:

esther            4201   0.0  0.0  2480224   2692   ??  S     6Sep17   0:00.82 spring server | panacea | started 191 hours ago
esther           41548   0.0  0.0  2432804    840 s002  S+   12:00PM   0:00.00 grep spring

It turned out I had a rails console server that had been running for 191hrs... Stopping that server resolved the issue.

@chrissyast
Copy link

Have found this gist a couple of times when this happened, but I couldn't find a running rails console. The way to kill the server was by running spring stop

@madipally
Copy link

Thanks for your suggestion, it was really helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment