[rails 4.1] when the rails command just hangs

For one of my projects I am using rails 4.1 (bleeding edge! yeah :) ) and suddenly noticed, that after opening my laptop in the morning my normal rails commands, like

$> rails c
$> rails g migration Bla name description some_more_fields

just ... were hanging and nothing happened??? Like they were waiting for further input. Upon closer investigation, I assumed that the connection to the spring process was lost/corrupt (I move between networks a lot? maybe that could explain it).

For those unaware, as I was, spring is a Rails application preloader. It speeds up development by keeping your application running in the background so you don't need to boot it every time you run a test, rake task or migration. Of course when that connection is lost, or corrupt, it hangs.

A simple

$> spring stop

stops the spring server, after which any rails command will restart it automatically. Fixed :)

Zeljko 2014-06-11 14:31:11 UTC

Yup, just happened to me, spring stop solved it. Love the invisible magic that breaks your system every now and then. Your post saved my day, at least the afternoon.

Joe 2014-07-02 05:26:28 UTC

Worked. Thank you very much for this write-up.

Damian 2014-07-16 18:37:17 UTC


thesp0nge 2014-10-10 08:32:38 UTC

You saved my day. Thank you Paolo

ryan 2015-01-18 12:09:02 UTC

It works. Thanks

Lou 2015-05-12 20:27:06 UTC

God I love you

Andrew 2015-07-16 03:15:56 UTC

Solved my issue! You're a genius! Thank you

Steve Crozier 2015-09-23 21:52:18 UTC

I don't love you, but I am now very, very fond of you. Thanks for this post. Saved me some heartache.

Christian Buchert 2015-10-15 05:57:30 UTC

You are my best friend right now.

james kemp 2015-10-18 12:36:49 UTC

Thank you, your answer and `spring stop` just saved me many hours of head scratching!!

Roman 2016-02-23 17:08:29 UTC

Awesome, that made the trick!

Mark Jackson 2016-03-12 01:07:07 UTC

Thank you!

Brandon 2016-06-30 15:09:42 UTC

Thanks bro! Worked for me as well.

mirko 2016-07-08 16:37:56 UTC

Thanks a lot! You saved my day!

Toons 2016-08-02 12:19:23 UTC

First google hit, ANSWER!! Thanks so much for taking the time to put this down.

Jesse 2016-10-05 22:24:26 UTC

Thank you very much!!! This just saved me so much time.

Alex 2016-11-25 12:43:03 UTC


Add comment

Recent comments