can't open rails server

后端 未结 3 1948
轮回少年
轮回少年 2020-12-25 08:39

I don\'t know what I did. I think I updated my Ruby on Rails. After updating it, I always get error when running $rails server.

output is

ruby-1.9.         


        
相关标签:
3条回答
  • 2020-12-25 09:21

    I think somehow your rails server is keep running after you close it. You can try as

    ps aux | grep ruby
    

    see pid and then kill that pid

    kill -9 <pid>
    

    Now you can restart your server using

    rails s
    

    Note: From next time onwards try using Ctrl D for terminating rails server. That might help

    0 讨论(0)
  • 2020-12-25 09:22

    run it on other port:

    rails s -p 3001
    

    so it'll load on localhost:3001

    or kill all ruby processes:

    killall ruby
    

    and then run rails s

    0 讨论(0)
  • 2020-12-25 09:24

    I too faced the issue it all because of ruby instances are not properly terminated.We can terminate processes running in the background by pids.

    lsof -wni tcp:3000
    

    It displays all running pids of ruby.and terminate that pids.

    kill -9 PID
    

    Or use

    killall ruby
    
    0 讨论(0)
提交回复
热议问题