无法打开rails服务器
我不知道我做了什么。我想我更新了我的 Ruby on Rails。更新后,运行 $rails 服务器时总是出错。
输出是
ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
我将重新启动控制台并运行 Rails 服务器,它会正常工作几分钟,但随后它将停止响应,如果我重新启动 Rails 服务器,它会再次出现该错误。我尝试在不同的端口(rails s -p 9191)上运行,它给了我同样的问题。
有什么想法我做错了什么吗?谢谢大家
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.2-p290/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
I would restart the console and run rails server and it would work fine for a couple of minutes but then it would stop responding and if I restart rails server it would give me that error again. I tried running on different port (rails s -p 9191) and it gives me the same problem.
Any Ideas what I did wrong? Thnx guys
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在其他端口上运行它:
这样它将加载到
localhost:3001
或终止所有 ruby 进程:
然后运行
rails
run it on other port:
so it'll load on
localhost:3001
or kill all ruby processes:
and then run
rails s
我认为您的 Rails 服务器在关闭后仍继续运行。您可以尝试
查看 pid,然后杀死该 pid
现在您可以使用注意:重新启动服务器
从下次开始尝试使用 Ctrl D 终止 Rails 服务器。这可能有帮助
I think somehow your rails server is keep running after you close it. You can try as
see pid and then kill that pid
Now you can restart your server using
Note: From next time onwards try using Ctrl D for terminating rails server. That might help
我也遇到了这个问题,这都是因为 ruby 实例没有正确终止。我们可以通过 pid 终止在后台运行的进程。
它显示 ruby 的所有正在运行的 pid。并终止该 pid。
或者使用
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.
It displays all running pids of ruby.and terminate that pids.
Or use