Somehow in my Development-Environment (Windows with Eclipse) webrick comes up with stale PID-Files.
I stop the Server, start it again and sometimes (not always) i get the message:
A server is already running.
This happend since i updated to rails-Version X.
But now i finally figured out (after googling and googling and finding nothing helpful) how to make it work again.
In application.rb before declaration of your own application insert:
1 | require 'stale_pid_cleaner' |
StalePidCleaner:
03 | fName = "./tmp/pids/server.pid" |
04 | if ( File .exists?(fName)) |
05 | puts "found pidfile: " + fName.to_s |
06 | pid = File .read(fName).to_i |
08 | puts "invalid pid? " + pid.to_s |
11 | puts "cleaning stale pidfile" |
23 | rescue Errno:: ESRCH , TypeError |
Hope it helps also someone else