The Middleman server hangs indefinitely in local development
Immediately after initiating the middleman server (with bundle exec middleman), and then change a file and save it, Middleman hangs and becomes unresponsive. It will build once and successfully serve the site indefinitely, until you change a file. Once it's hanging, the only way to exit the program, so far as I have found, is by forcefully killing the process (kill -9 pid or ctrl-z).
Frustratingly, there's no stack trace. @marcia confirmed she's seeing this as well.
** Update **
This is a known issue with middleman, and has been occurring for quite a long time (since '13).
From what I've read, the problem has to do with one of Middleman's gem dependencies: therubyracer, which embeds the V8 JavaScript interpreter into Ruby, which as far as I can tell, is only used to compile less files.
There's a workaround folks are using without really knowing why it works: setting a flag in your local environment to use Node.js as the JS runtime (???) before running Middleman. So:
EXECJS_RUNTIME=Node bundle exec middleman server
I've tested it, and it does the trick. I'm curious if it would be possible to just stop depending on therubyracer since we don't use it to compile .less files. Or maybe we can set the environment variable for people by default? Honestly, I'm out of my depth here... still somewhat new to Ruby. Maybe making a note in the docs will be enough?
GitHub issues: https://github.com/middleman/middleman/issues/652 https://github.com/middleman/middleman/issues/1367