swa*_*esh 124 ruby-on-rails command-prompt webrick ruby-on-rails-3.2
当我使用rails s命令启动rails server时,它正在显示A server is already running. Check C:/Sites/folder/Pids/Server.pids
当我打开文件时,它只输出一个4位数字,那么我怎么能解决这个问题呢?
FYI
cmd.exe显示没有正在运行的其他进程.(使用Windows).rai*_*inz 184
删除文件:C:/Sites/folder/Pids/Server.pids
Tai*_*aiz 143
旧解决方案:
sudo kill -9 $(lsof -i :3000 -t)
Run Code Online (Sandbox Code Playgroud)
你也可以找到这篇文章以获得更多选项 Rails Update to 3.2.11中断运行多个服务器
新解决方案
当你运行rails s
=>启动WEBrick
=> Rails 4.0.4应用程序从开发开始 http://0.0.0.0:3000
=>运行rails server -h以获取更多启动选项
=> Ctrl-C关闭服务器
服务器已在运行.检查/your_project_path/tmp/pids/server.pid. 退出
因此,请将此处显示的路径放在/your_project_path/tmp/pids/server.pid中
并删除此server.pid文件:
rm /your_project_path/tmp/pids/server.pid
Run Code Online (Sandbox Code Playgroud)
或者,如果您的服务器已分离,请遵循以下指南:
如果你使用命令"rails -d"分离了rails服务器,那么,
使用命令删除已分离的服务器
ps -aef | grep rails
Run Code Online (Sandbox Code Playgroud)
或者通过这个命令
sudo lsof -wni tcp:3000
Run Code Online (Sandbox Code Playgroud)
然后
kill -9 pID
Run Code Online (Sandbox Code Playgroud)
或使用此命令
按运行该程序的端口名称查找和终止进程.对于运行程序的3000替换端口.
sudo kill -9 $(lsof -i :3000 -t)
Run Code Online (Sandbox Code Playgroud)
Jos*_*edo 83
lsof -wni tcp:3000
Run Code Online (Sandbox Code Playgroud)
然后你应该看到红宝石过程,你可以运行
kill -9 processid
Run Code Online (Sandbox Code Playgroud)
你现在应该好好运行这个过程
rails s thin
Run Code Online (Sandbox Code Playgroud)
运行多个过程似乎不是一个好主意,从我读过的很多人都同意.遗憾的是,我注意到很多内存泄漏了,所以我无法想象有两个进程在运行.我知道有一个加班我的页面刷新越来越慢,因为数据存储在内存中.
Kar*_*hit 26
kill -9 $(lsof -i tcp:3000 -t)
Run Code Online (Sandbox Code Playgroud)
小智 10
$ lsof -wni tcp:3000
# Kill the running process
$ kill -9 5946
$ rm tmp/server.pids
Run Code Online (Sandbox Code Playgroud)
工头开始等启动服务
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
Run Code Online (Sandbox Code Playgroud)
当您终止服务器进程并且 pid 文件未更新时,就会发生这种情况。最好的解决方案是删除文件Server.pid。
使用命令
rm <path to file Server.pid>
| 归档时间: |
|
| 查看次数: |
115105 次 |
| 最近记录: |