LoginSignup
17
13

More than 1 year has passed since last update.

rails s 時のエラー「Address already in use - bind(2) for "0.0.0.0" port 3000」の解決法【初心者】

Last updated at Posted at 2020-01-27

環境

結論:別のポートで立ち上げるのが早い

rails s -p 3001というコマンドを入力すればOKです。

サーバーを立ち上げる際のlocalhost:3000は実は3000以外にも数字があるので3001番などで立ち上げるのが手っ取り早いです。

エラー内容

rails sをすると以下のようなエラーが出ます。

/Users/shogo/environment/sample_app/vendor/bundle/ruby/2.6.0/gems/puma-3.9.1/lib/puma/binder.rb:269:in initialize': Address already in use - bind(2) for "0.0.0.0" port 3000 (Errno::EADDRINUSE)

解決方法

localhost:3000が使われているという意味なので、localhost:3001番でサーバーを立ち上げてあげます。

以下のコマンドをターミナルに入力します。
rails s -p 3001

これで解決です。

どうしても3000番でサーバーを立ち上げたいということであれば以下のURLを参考にしてください。

備忘録として手短に。何かあれば追記します。

もっと詳しくみるにはこちら→rails sが通らない

17
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
13