February 2019
Intermediate to advanced
240 pages
5h 25m
English
For some reason, occasionally upon terminating the app with Compose (pressing Ctrl-C), the Rails server doesn’t seem to shut down cleanly, and its server.pid file—which Rails stores in tmp/pids/—isn’t deleted. This means that upon starting the app again with:
| | $ docker-compose up |
you may find yourself confronted by the following error in the output:
| | ... |
| | A server is already running. Check /usr/src/app/tmp/pids/server.pid |
| | ... |
The existence of the pid file makes the Rails server starting up believe that there’s a server already running, so it won’t launch.
Rails saves the server.pid file in tmp/pids. Since we’re mounting our local app directory into the container, the file ends up in the ...