Can't stop rails server

前端 未结 27 1964
别跟我提以往
别跟我提以往 2020-12-04 05:12

I am new to rails and I am using an ubuntu machine and the rubymine IDE. The problem is that I am unable to stop the rails server. I tried to stop the server by killing the

相关标签:
27条回答
  • 2020-12-04 05:23

    Follow these steps:

    1. open your project
    2. select in tmp folder
    3. select pids folder
    4. delete server.pid file
    5. now start your rails server
    0 讨论(0)
  • 2020-12-04 05:24

    1. Simply Delete the pid file from rails app directory

    Rails_app -> tmp -> pids -> pid file

    Delete the file and run

    rails start


    2. For Rails 5.0 and above, you can use this command

    rails restart

    0 讨论(0)
  • 2020-12-04 05:25

    pkill -9 rails to kill all the process of rails

    Updated answer

    ps aux|grep 'rails'|grep -v 'grep'|awk '{ print $2 }'|xargs kill -9

    This will kill any running rails process. Replace 'rails' with something else to kill any other processes.

    0 讨论(0)
  • 2020-12-04 05:25

    On rails 6 using

    ps aux | grep rails was not returning the server process

    I had to do

    ps aux | grep puma

    to find the actual process and then kill it using

    kill -9 {process_id}

    0 讨论(0)
  • 2020-12-04 05:26

    Following are steps to kill server process:

    1. lsof -i tcp:3000

    2. kill -9 1234

    where 1234 is the PID of process: localhost:3000 display in step 1.

    OR

    Remove file(server.pid) under Rails.root/tmp/pids/ and restart server.

    OR

    open app in another port by using command:

    rails s -p 3001

    0 讨论(0)
  • 2020-12-04 05:26

    One super easy way would be

    gem install shutup

    then go in the current folder of your rails project and run

    shutup # this will kill the Rails process currently running

    You can use the command 'shutup' every time you want

    DICLAIMER: I am the creator of this gem

    NOTE: if you are using rvm install the gem globally

    rvm @global do gem install shutup
    
    0 讨论(0)
提交回复
热议问题