每次我在不同的端口上运行 2 个 rails 服务器时都会说 3000 和 3001。
在端口 3000 上启动服务器后
Rails$ rails s -p 3000
=> Booting Mongrel
=> Rails 3.1.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
当我在端口 3001 上运行第二个 rails 服务器时,
Rails$ rails s -p 3001
=> Booting Mongrel
=> Rails 3.1.1 application starting in development on http://0.0.0.0:3001
=> Call with -d to detach
=> Ctrl-C to shutdown server
A server is already running. Check /Rails/tmp/pids/server.pid.
Exiting
我需要删除 server.pid 文件,然后才能在端口 3001 上启动 rails 服务器。有没有办法避免每次都删除文件?