質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
87.20%
Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

解決済

rails serverの起動について

sairito0628
sairito0628

総合スコア15

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

2回答

0評価

1クリップ

471閲覧

投稿2019/02/07 20:05

はじめに⇩
Pumaが起動しなかった

エラー文①⇩
=> Booting Puma

=> Rails 5.1.4 application starting in development

=> Run rails server -h for more startup options

A server is already running. Check

・・・/tmp/pids/server.pid.

Exiting

対処法⇩
https://trend-tracer.com/rails_error/
このサイトをみて、
/tmp/pids/server.pid.
のserver.pid.を消してみた。
そして再度、$rails sをすると

=> Booting Puma
=> Rails 5.2.2 application starting in development
=> Run rails server -h for more startup options
Puma starting in single mode...

  • Version 3.12.0 (ruby 2.5.3-p105), codename: Llamas in Pajamas
  • Min threads: 5, max threads: 5
  • Environment: development
  • Listening on tcp://localhost:8080

Exiting
Traceback (most recent call last):
43: from bin/rails:3:in <main>' 42: from bin/rails:3:in load'
41: from /home/ec2-user/environment/sample-app/bin/spring:15:in <top (required)>' 40: from /home/ec2-user/environment/sample-app/bin/spring:15:in require'
39: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/binstub.rb:31:in <top (required)>' 38: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/binstub.rb:31:in load'
37: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-
19: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command' 18: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor/command.rb:27:in run'
17: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in perform' 16: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in tap'
15: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:147:in block in perform' 14: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:53:in start'
13: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/rack-2.0.6/lib/rack/server.rb:297:in start' 12: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/rack/handler/puma.rb:70:in run'
11: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/launcher.rb:184:in run' 10: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/single.rb:96:in run'
9: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/runner.rb:151:in load_and_bind' 8: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:88:in parse'
7: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:88:in each' 6: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:105:in block in parse'
5: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:265:in add_tcp_listener' 4: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:265:in each'
3: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:266:in block in add_tcp_listener' 2: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:272:in add_tcp_listener'
1: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:272:in new' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:272:in initialize': Address already in use - bind(2) for "127.0.0.1" port 8080 (Errno::EADDRINUSE)
ec2-user:~/environment/sample-app (master) $ rails s
=> Booting Puma
=> Rails 5.2.2 application starting in development
=> Run rails server -h for more startup options
Puma starting in single mode...

  • Version 3.12.0 (ruby 2.5.3-p105), codename: Llamas in Pajamas
  • Min threads: 5, max threads: 5
  • Environment: development
  • Listening on tcp://localhost:8080

Exiting
Traceback (most recent call last):
43: from bin/rails:3:in <main>' 42: from bin/rails:3:in load'
41: from /home/ec2-user/environment/sample-app/bin/spring:15:in <top (required)>' 40: from /home/ec2-user/environment/sample-app/bin/spring:15:in require'
39: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/binstub.rb:31:in <top (required)>' 38: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/binstub.rb:31:in load'
37: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/bin/spring:49:in <top (required)>' 36: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/client.rb:30:in run'
35: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/client/command.rb:7:in call' 34: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in call'
33: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in load' 32: from /home/ec2-user/environment/sample-app/bin/rails:9:in <top (required)>'
31: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in require' 30: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in load_dependency'
29: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in block in require' 28: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require'
27: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in require_with_bootsnap_lfi' 26: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in register'
25: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in block in require_with_bootsnap_lfi' 24: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require'
23: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands.rb:18:in <main>' 22: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/command.rb:46:in invoke'
21: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/command/base.rb:65:in perform' 20: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor.rb:387:in dispatch'
19: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command' 18: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor/command.rb:27:in run'
17: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in perform' 16: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in tap'
15: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:147:in block in perform' 14: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:53:in start'
13: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/rack-2.0.6/lib/rack/server.rb:297:in start' 12: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/rack/handler/puma.rb:70:in run'
11: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/launcher.rb:184:in run' 10: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/single.rb:96:in run'
9: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/runner.rb:151:in load_and_bind' 8: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:88:in parse'
7: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:88:in each' 6: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:105:in block in parse'
5: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:265:in add_tcp_listener' 4: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:265:in each'
3: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:266:in block in add_tcp_listener' 2: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:272:in add_tcp_listener'
1: from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:272:in new' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/puma-3.12.0/lib/puma/binder.rb:272:in initialize': Address already in use - bind(2) for "127.0.0.1" port 8080 (Errno::EADDRINUSE)

このエラーが発生。
解決法がわかる方、よろしくお願いします。

良い質問の評価を上げる

以下のような質問は評価を上げましょう

  • 質問内容が明確
  • 自分も答えを知りたい
  • 質問者以外のユーザにも役立つ

評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。

気になる質問をクリップする

クリップした質問は、後からいつでもマイページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。

  • プログラミングに関係のない質問
  • やってほしいことだけを記載した丸投げの質問
  • 問題・課題が含まれていない質問
  • 意図的に内容が抹消された質問
  • 過去に投稿した質問と同じ内容の質問
  • 広告と受け取られるような投稿

評価を下げると、トップページの「アクティブ」「注目」タブのフィードに表示されにくくなります。

まだ回答がついていません

会員登録して回答してみよう

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
87.20%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問

同じタグがついた質問を見る

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。