I was building a docker image. Nothing foretold troubles, but then:
Step 7/13 : RUN SECRET_KEY_BASE=`bin/rake secret` RAILS_ENV=production bin/rails assets:precompile
---> Running in 51605ddacc67
FATAL: Listen error: unable to monitor directories for changes.
Visit https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers for info
on how to fix this.
Okay, the system was out of inotify watches,
but why would I want that in the first place? Inspecting $GEM_HOME revealed that this message comes from—not surprisingly—the listen gem. Which is needed by spring-watcher-listen (Gemfile.lock).
Which was added to rails in 5.0.0.beta3.
But why does spring start again? Well, the culprit is bin/rake secret command. Had it been bin/rails secret,
the issue wouldn't have arised. That's because only bin/rails {console,runner,generate,destroy,test} start the spring server.
The other subcommands don't.
P.S. Make sure you do bundle install --without development test in production. Missing
spring gem gets ignored.