I was practicing doing ruby on rails and I accidentally closed Visual Studio code while the terminal and rails server is running.
This is what happened after i typed rails s
PS C:\Users\Lenovo\Desktop\folder_name\project_name rails s
=> Booting Puma
=> Rails 6.1.4.1 application starting in development
=> Run `bin/rails server --help` for more startup options
A server is already running. Check C:/Users/Lenovo/Desktop/folder_name/project_name/tmp/pids/server.pid.
Exiting
CodePudding user response:
Find the process id for the rails server port :
lsof -wni tcp:3000
Copy value in PID column
Kill the process (for example 14400) :
kill -9 14400
CodePudding user response:
You can use this command to kill the server using port number.
sudo kill -9 $(lsof -i :3000 -t)
CodePudding user response:
The user just needed to delete the server.pid file and it worked.