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

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

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

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

Q&A

解決済

1回答

13689閲覧

【Rails】Pumaが起動出来ない問題

gogoackman3

総合スコア109

Ruby on Rails

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

1グッド

1クリップ

投稿2017/03/29 04:03

EC2にデプロイを終え、いざ、pumaを起動するために、
bundle exec pumaを実行したところ以下のエラーに遭遇しました。

ruby

1 sample git:(master) bundle exec puma 2Puma starting in single mode... 3* Version 3.7.0 (ruby 2.4.1-p111), codename: Snowy Sagebrush 4* Min threads: 5, max threads: 5 5* Environment: production 6/home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated 7/home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated 8/home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/core_ext/numeric/conversions.rb:138: warning: constant ::Fixnum is deprecated 9/home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activejob-5.0.1/lib/active_job/arguments.rb:38: warning: constant ::Fixnum is deprecated 10/home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activejob-5.0.1/lib/active_job/arguments.rb:38: warning: constant ::Bignum is deprecated 11* Listening on tcp://0.0.0.0:3000 12* Listening on unix:///var/www/rails/sample/tmp/sockets/puma.sock 13bundler: failed to load command: puma (/home/sample/.rbenv/versions/2.4.1/bin/puma) 14Errno::ENOENT: No such file or directory - connect(2) for /var/www/rails/sample/tmp/sockets/puma.sock 15 /home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.7.0/lib/puma/binder.rb:366:in `initialize' 16 /home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.7.0/lib/puma/binder.rb:366:in `new' 17 /home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.7.0/lib/puma/binder.rb:366:in `add_unix_listener' 18 /home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.7.0/lib/puma/binder.rb:141:in `block in parse' 19 /home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.7.0/lib/puma/binder.rb:88:in `each' 20 /home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.7.0/lib/puma/binder.rb:88:in `parse' 21 /home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.7.0/lib/puma/runner.rb:144:in `load_and_bind' 22 /home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.7.0/lib/puma/single.rb:87:in `run' 23 /home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.7.0/lib/puma/launcher.rb:171:in `run' 24 /home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.7.0/lib/puma/cli.rb:77:in `run' 25 /home/sample/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/puma-3.7.0/bin/puma:10:in `<top (required)>' 26 /home/sample/.rbenv/versions/2.4.1/bin/puma:22:in `load' 27 /home/sample/.rbenv/versions/2.4.1/bin/puma:22:in `<top (required)>'

/config/puma.rbの設定は以下の通りです。

ruby

1threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i 2threads threads_count, threads_count 3 4# Specifies the `port` that Puma will listen on to receive requests, default is 3000. 5# 6port ENV.fetch("PORT") { 3000 } 7 8# Specifies the `environment` that Puma will run in. 9# 10environment ENV.fetch("RAILS_ENV") { "production" } 11 12# Allow puma to be restarted by `rails restart` command. 13plugin :tmp_restart 14 15app_root = File.expand_path("../..",__FILE__) 16bind "unix://#{app_root}/tmp/sockets/puma.sock" 17pidfile "#{app_root}/tmp/pids/puma.pid" 18state_path "#{app_root}/tmp/pids/puma.state" 19# daemonize true

エラーの通り、確かに、/var/www/rails/sample/tmp/socketsにpuma.sockというファイルが生成されていませんでした。

これは自分で手動で作成しなければいけないのでしょうか??
以前別のrailsアプリをデプロイした際には手動で作成した記憶がなく、何か他に問題があるのかな?とは思うのですが・・・。

お分かりになりましたら、教えて頂けると幸いです!

ikore908👍を押しています

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

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

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

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

自分でディレクトリを作成すると、エラーなく起動出来ました。

ruby

1cd /var/www/rails/sample/tmp 2mkdir sockets

投稿2017/03/29 05:27

gogoackman3

総合スコア109

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問