hagetak's blog

どうも、はげたかです。

A server is already running時の対処(Rails)

以下のコマンドでサーバーが立ち上がらない時の対処

% rails s

                                                        
=> Booting WEBrick
=> Rails 4.1.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
A server is already running. Check /Users/<username>/Dropbox/<applicationName>/tmp/pids/server.pid.
Exiting

この場合、 server.pid を削除すればOKなので

カレントディレクトリにいる場合、以下のコマンドを打つ

% rm /tmp/pids/server.pid

これで解決。

解決できない場合は、ターミナルを一旦閉じればおkだと思う。