2

Basically same problem as here: Server is already running in Rails

A server is already running. Check /app/tmp/pids/server.pid.
=> Booting Puma
=> Rails 6.0.3.1 application starting in production
=> Run `rails server --help` for more startup options
Exiting
A server is already running. Check /app/tmp/pids/server.pid.

but inside a docker container I cannot remove .pid file becuase container never starts.

Please help!

markmnl
  • 11,116
  • 8
  • 73
  • 109

2 Answers2

3

You can remove .pid before running server, add to docker-compose some script before firing up server:

command: bash -c bin/start.sh

File: bin/start.sh

rm -f tmp/pids/server.pid
exec bundle exec rails s -b 0.0.0.0
nuaky
  • 2,036
  • 1
  • 14
  • 20
0

simply go into the specfied directory of project and delete that server.pid this will solve your problem

Haider Bajwa
  • 114
  • 7
  • 1
    Welcome to SO. When answering a question (especially and older one with other answers) it helps to explain how yours is different or improves on the others. Specifically, your answer appears to be the same as the accepted answer. – rmlockerd Aug 06 '21 at 21:01