简体   繁体   中英

Unable to start rails server

I am trying to start rails server using rails s command. But i'm getting the following error:

A server is already running. Check repo/tmp/pids/server.pid.

I checked the file, but its blank. There is no id in the server.pid file. Then I tried to find out the process running on port 3000 using the command lsof -wni tcp:3000 . It also does not show any id.

Then I tried starting the server on a different port using rails s -p 3001 , but this also gives the same error. Please could someone explain what is going on.

Thanks

EDIT: does not work even after restarting computer

只需删除该文件:

 rm repo/tmp/pids/server.pid

Try running this command in your terminal window.

kill -9 $(lsof -i tcp:3000 -t)

If it doesn't work, you can always just restart your computer/server...

1- Use the command below for checking that how many server currently running

$ ps aux | grep rails


2- For killing the existing server

$ kill -9 pid

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM