Skip to Content
Docker for Rails Developers
book

Docker for Rails Developers

by Rob Isenberg
February 2019
Intermediate to advanced
240 pages
5h 25m
English
Pragmatic Bookshelf
Content preview from Docker for Rails Developers

Rails tmp/pids/server.pid Not Cleaned Up

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn Rails 6: Accelerated Web Development with Ruby on Rails

Learn Rails 6: Accelerated Web Development with Ruby on Rails

Adam Notodikromo
Mastering Ruby Closures

Mastering Ruby Closures

Benjamin Tan Wei Hao

Publisher Resources

ISBN: 9781680506730Errata Page