Rails 更新到 3.2.11 中断运行多个服务器 [英] Rails Update to 3.2.11 breaks running multiple servers
问题描述
我们的应用程序在彼此通信的不同端口上运行两个 Rails 服务器.使用 Rails 3.2.8,我可以打开一个终端,cd
到项目,运行 rails s -p3000
,打开另一个终端,运行 rails s -p3001
一切正常.gemfile 包含 thin
,所以 thin
会自动启动,但使用 rails s
将允许使用 --debugger代码> 需要时.
Our application runs two Rails servers at different ports that talk to each other. Using Rails 3.2.8, I could open a terminal, cd
to the project, run rails s -p3000
, open another terminal, run rails s -p3001
and everything worked fine. The gemfile contains thin
, so thin
would be launched automatically, but using the rails s
would allow using the --debugger
when needed.
自从更新 Rails 3.2.11 后,这不再有效.我收到错误消息:服务器已经在运行.检查/home/george/Projects/dashboard/tmp/pids/server.pid".我可以直接在两个端口上启动 thin
,但没有调试支持.在一个上启动 thin
并在另一个上启动 rails
似乎不起作用,但不清楚当错误停止服务器时所有服务器任务都被终止了.
Since updating the Rails 3.2.11 this no longer works. I get an error: "A server is already running. Check /home/george/Projects/dashboard/tmp/pids/server.pid". I can launch thin
directly on both ports, but then have no debugging support. Launching thin
on one and rails
on the other seemed to not work, but it was not clear that all the server tasks were getting killed when the error stopped the server.
推荐答案
这两个命令都在检查默认的 PID 文件位置 (tmp/pids/server.pid
),因此您会看到此错误.尝试像这样运行多个服务器:
Both commands are checking the default PID file location (tmp/pids/server.pid
), so you're seeing this error. Try running multiple servers like so:
服务器 1: bundle exec rails s
服务器 2: bundle exec rails s -p 3001 -P tmp/pids/server2.pid
这篇关于Rails 更新到 3.2.11 中断运行多个服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!