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

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

新規登録して質問してみよう
ただいま回答率
85.46%
Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

PostgreSQL

PostgreSQLはオープンソースのオブジェクトリレーショナルデータベース管理システムです。 Oracle Databaseで使われるPL/SQLを参考に実装されたビルトイン言語で、Windows、 Mac、Linux、UNIX、MSなどいくつものプラットフォームに対応しています。

Q&A

解決済

2回答

796閲覧

herokuの H10のエラーがわからない。

moonlight4_6_17

総合スコア12

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

PostgreSQL

PostgreSQLはオープンソースのオブジェクトリレーショナルデータベース管理システムです。 Oracle Databaseで使われるPL/SQLを参考に実装されたビルトイン言語で、Windows、 Mac、Linux、UNIX、MSなどいくつものプラットフォームに対応しています。

0グッド

0クリップ

投稿2021/05/18 13:15

編集2021/05/19 07:32

達成したいこと

herokuでデプロイしたアプリを動かしたい

困っていること

一番最初デプロイした時は正常に動いていたが、アプリを改修して再度見てみたら、エラーが出てしまい原因が突き止められないでいる。

$ heroku run rails console
などは正常に起動する。

可能性が考えられる原因などお分かりになる方いたらご教授いただけたらと思います。

実際のエラー文

エラー文、追記しました。
No such file or directory @ rb_sysopen - tmp/pids/server.pid (Errno::ENOENT)
が問題なんだと思うのですが、、、

一応、
/tmp/pids/.keep
/tmp/pids/server.pid
/tmp/sockets
は存在してます。。

2021-05-19T06:58:42.876497+00:00 app[web.1]: /app/vendor/bundle/ruby/2.7.0/gems/puma-3.12.6/lib/puma/launcher.rb:133:in `initialize': No such file or directory @ rb_sysopen - tmp/pids/server.pid (Errno::ENOENT) 2021-05-19T06:58:42.876521+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.7.0/gems/puma-3.12.6/lib/puma/launcher.rb:133:in `open' ・・・(略) 2021-05-18T09:43:15.229755+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=frozen-headland-37737.herokuapp.com request_id=9c344d3b-808f-4df8-8943-3c85a65c31b1 fwd="106.171.69.190" dyno= connect= service= status=503 bytes= protocol=https 2021-05-18T09:43:15.929215+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=frozen-headland-37737.herokuapp.com request_id=9020ccfa-4506-46af-ad65-104c89ef24ca fwd="106.171.69.190" dyno= connect= service= status=503 bytes= protocol=https

package.json

{ "name": "next", "private": true, "dependencies": { "serve": "^11.3.2" } }

Gemfile

source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.7.3' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.5' # Use Puma as the app server gem 'puma', '~> 3.11' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'mini_racer', platforms: :ruby # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.5' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use ActiveModel has_secure_password gem 'bcrypt', '~> 3.1.7' # Use ActiveStorage variant gem 'mini_magick', '~> 4.8' gem 'carrierwave' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.1.0', require: false gem 'bootstrap' gem 'jquery-rails' gem 'pry-rails' gem 'mini_racer' gem 'public_uid' gem 'rails-i18n' group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'sqlite3' end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' end group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of chromedriver to run system tests with Chrome gem 'chromedriver-helper' gem 'minitest' gem 'minitest-reporters' gem 'guard' gem 'guard-minitest' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] group :production do gem 'pg' end

Procfile

web: bundle exec puma -C config/puma.rb

puma.rb

workers Integer(ENV['WEB_CONCURRENCY'] || 2) threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5) threads threads_count, threads_count preload_app! rackup DefaultRackup port ENV['PORT'] || 3000 environment ENV['RACK_ENV'] || 'development' on_worker_boot do # Worker specific setup for Rails 4.1+ # See: https://devcenter.heroku.com/articles/ # deploying-rails-applications-with-the-puma-web-server#on-worker-boot ActiveRecord::Base.establish_connection end

database.yml

default: &default adapter: postgresql pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> timeout: 5000 development: <<: *default database: db/development_postgresql test: <<: *default database: db/test_postgresql production: <<: *default database: db/production_postgresql

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

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

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

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

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

siruku6

2021/05/18 23:51

https://mophie-blog.com/2020/08/16/app-erro-in-heroku-h10-app-crashed/ https://qiita.com/GalaxyNeko/items/e62885cc3976e66a6215 こんな記事があるようですが、試してみましたか? どうやら、見た感じ、アプリ側に問題があるにも関わらずエラー原因が表示されていないかもしくは見落としている可能性があるようです。 複数の方が原因不明として対処を開始しているところを見ると、一見してわかるところには原因が表示されていないのだと思われますので、まずは、どうやって原因を表示させるか、から調べていくと良さそうです。
moonlight4_6_17

2021/05/19 07:33

siruku6さん ご親切にありがとうございます! 参考にして原因探ってみます!
guest

回答2

0

自己解決

こちらは一旦クローズとさせて頂きます。
ご協力いただいた皆さん、ありがとうございました。

投稿2021/07/12 06:37

moonlight4_6_17

総合スコア12

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

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

0

追記確認しました。

エラーは、No such file or directory @ rb_sysopen - tmp/pids/server.pid (Errno::ENOENT)ですね。

私はrails4でしかherokuデプロイをしていなかったのでわからないのですが、
rails6の新機能か何かが追加されたのが原因なのか、config/puma.rb内の以下の記述をコメントアウトすると動作するようになると書いている記事がありました。

ruby

1pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }

【初心者向け】Herokuでデプロイしたら code=H10 desc="App crashed" とか言われた時の解決法

真偽は定かではないのですが、試してみる価値はあると思います。


ちなみに、検索キーワードとしては、

  • heroku
  • No such file or directory @ rb_sysopen - tmp/pids/server.pid (Errno::ENOENT)

を検索窓に入れて検索してヒットさせることができましたので、今後の情報検索の参考にしていただければ幸いです。

投稿2021/05/22 12:41

siruku6

総合スコア1382

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

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

siruku6

2021/05/22 12:43 編集

さらに補足ですが、質問のタグには、railsやrailsのバージョンも指定しておくとよいでしょう。 それがあった方が、回答する方がこの質問にたどり着きやすくなると思います。 あとpostgresplは関係ないので、タグから外しておくのもよいと思います。 それがあるせいで倦厭してこの質問を開かない人もいると思います(postgresqlに苦手意識がある人とか)
moonlight4_6_17

2021/05/22 16:52

siruku6さん ご丁寧にありがとうございます! ぜひ、試してみます! 初学者なので、検索の仕方や、teratailのタグのことも非常に勉強になります!! ありがとうございます!!!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.46%

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

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

質問する

関連した質問