Wednesday, June 22, 2011

Development TitBits

Port Already In Use:

Sometimes, some process might be holding the required port during development process. This should have happened when the earlier dev web server was not shutdown properly.

Use the following command to find out which process is using the port no 3000

 sudo netstat -lpn | grep 3000

and you will get output similar to the below line
tcp        0      0  *               LISTEN      10416/rails

where 10416 is the process id of the process holding the particular port no 3000.
So kill the process with id 10416 using the following command

kill 10416

But be sure that you are killing some processes which are related to your development only. I knew that the rails development server which i was using was the one which might be holding the port 3000. So, i was sure that i can kill that process.

No comments:

Post a Comment