CarbazochromeT / drug_app

drug_app
0 stars 0 forks source link

Herokuのデプロイエラーを改善したい #14

Closed CarbazochromeT closed 1 year ago

CarbazochromeT commented 1 year ago

お世話になっております。 今現在Herokuへのデプロイでのエラーを潰しているのですが、gem周りのなかなか減らず、heroku run rails cでコンソールを立ち上げようとするとアプリがクラッシュしてしまいます。ご助言をお願いいたします。 データベースはMySQLを使用予定です。 Gemfileは一度更新し、Procfileファイルは作っております。 Heroku、Node.js、Ruby、Railsをインストールし直す際に、bundleのバージョンを上げてしまったのが原因でしょうか。 現在、Railsは7.0.8、Rubyは3.1.4です。

$ ruby -v      
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [arm64-darwin22]

# anago @ flarenoMacbook-Air in ~/workspace/runteq/応用編/drug_app5/vendor/bundle on git:searchform x [6:53:07] 
$ rails -v
Rails 7.0.8

Puma関連のエラーが多いため、その辺の設定の仕方が原因だとも考えられます。 また、rubyのバージョンが3.1.4ですが、venderの中身の3.1.0ファイルが反応しないことが気になります。 venderファイルで重複しているものがあったら消した方がいいのでしょうか。 よろしくお願いいたします。

# anago @ flarenoMacbook-Air in ~/workspace/runteq/応用編/drug_app5/vendor/bundle on git:searchform x [6:46:49] 
$ heroku run rails c    

Running rails c on ⬢ care-drug-searcher... up, run.9112 (Basic)
/app/app/fields/has_many.rb:1:in `require_relative': cannot load such file -- /app/app/fields/associative (LoadError)
        from /app/app/fields/has_many.rb:1:in `<main>'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:30:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:135:in `cget'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:175:in `block in actual_eager_load_dir'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:25:in `each'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:25:in `ls'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:170:in `actual_eager_load_dir'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:16:in `each'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:379:in `block in eager_load_all'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:377:in `each'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:377:in `eager_load_all'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `instance_exec'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `run'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:61:in `block in run_initializers'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `call'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:60:in `run_initializers'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application.rb:372:in `initialize!'
        from /app/config/environment.rb:5:in `<main>'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application.rb:348:in `require_environment!'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/actions.rb:28:in `require_environment!'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/console/console_command.rb:105:in `perform'
        from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
        from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
        from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/base.rb:87:in `perform'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command.rb:48:in `invoke'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/bin/rails:4:in `<main>'

# anago @ flarenoMacbook-Air in ~/workspace/runteq/応用編/drug_app5/vendor/bundle on git:searchform x [6:47:17] 
$ bundle doctor         
Your Gemfile lists the gem ransack (>= 0) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once.
While it's not a problem now, it could cause errors if you change the version of one of them later.
The Gemfile's dependencies are satisfied
Files exist in the Bundler home that are not readable/writable by the current user. These files are:
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/.autotest
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/History.rdoc
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/Manifest.txt
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/README.rdoc
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/Rakefile
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/design_rationale.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/hoe/minitest.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/assertions.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/autorun.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/benchmark.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/expectations.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/hell.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/mock.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/parallel.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/pride.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/pride_plugin.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/spec.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/test.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/test_task.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest/unit.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/lib/minitest.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/test/minitest/metametameta.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/test/minitest/test_minitest_assertions.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/test/minitest/test_minitest_benchmark.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/test/minitest/test_minitest_mock.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/test/minitest/test_minitest_reporter.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/test/minitest/test_minitest_spec.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/test/minitest/test_minitest_test.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/selenium-webdriver-4.10.0/LICENSE
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/selenium-webdriver-4.10.0/NOTICE
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/selenium-webdriver-4.10.0/bin/linux/selenium-manager
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/selenium-webdriver-4.10.0/bin/macos/selenium-manager
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/selenium-webdriver-4.10.0/bin/windows/selenium-manager.exe
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/selenium-webdriver-4.10.0/lib/selenium/webdriver/atoms/findElements.js
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/selenium-webdriver-4.10.0/lib/selenium/webdriver/atoms/getAttribute.js
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/selenium-webdriver-4.10.0/lib/selenium/webdriver/atoms/isDisplayed.js
 - /Users/flare_home/workspace/runteq/応用編/drug_app5/vendor/bundle/ruby/3.1.0/gems/selenium-webdriver-4.10.0/lib/selenium/webdriver/atoms/mutationListener.js
No issues found with the installed bundle

# anago @ flarenoMacbook-Air in ~/workspace/runteq/応用編/drug_app5/vendor/bundle on git:searchform x [6:47:46] 
$ heroku logs --tail
2023-10-04T15:09:28.877705+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
2023-10-04T15:09:28.877714+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
2023-10-04T15:09:28.877724+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
2023-10-04T15:09:28.877734+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'
2023-10-04T15:09:28.877744+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/libexec/bundle:48:in `block in <top (required)>'
2023-10-04T15:09:28.877753+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/friendly_errors.rb:120:in `with_friendly_errors'
2023-10-04T15:09:28.877763+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/libexec/bundle:36:in `<top (required)>'
2023-10-04T15:09:28.877773+00:00 app[web.1]: from /app/bin/bundle:108:in `load'
2023-10-04T15:09:28.877783+00:00 app[web.1]: from /app/bin/bundle:108:in `<main>'
2023-10-04T15:09:29.039910+00:00 heroku[web.1]: Process exited with status 1
2023-10-04T15:09:29.072945+00:00 heroku[web.1]: State changed from starting to crashed
2023-10-04T17:55:37.585473+00:00 heroku[web.1]: State changed from crashed to starting
2023-10-04T17:55:46.336757+00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rb`
2023-10-04T17:55:48.563975+00:00 app[web.1]: [2] Puma starting in cluster mode...
2023-10-04T17:55:48.564041+00:00 app[web.1]: [2] * Puma version: 5.6.6 (ruby 3.1.4-p223) ("Birdie's Version")
2023-10-04T17:55:48.564054+00:00 app[web.1]: [2] *  Min threads: 5
2023-10-04T17:55:48.564067+00:00 app[web.1]: [2] *  Max threads: 5
2023-10-04T17:55:48.564081+00:00 app[web.1]: [2] *  Environment: production
2023-10-04T17:55:48.564097+00:00 app[web.1]: [2] *   Master PID: 2
2023-10-04T17:55:48.564111+00:00 app[web.1]: [2] *      Workers: 2
2023-10-04T17:55:48.564137+00:00 app[web.1]: [2] *     Restarts: (✔) hot (✖) phased
2023-10-04T17:55:48.564149+00:00 app[web.1]: [2] * Preloading application
2023-10-04T17:55:51.461475+00:00 app[web.1]: [2] ! Unable to load application: LoadError: cannot load such file -- /app/app/fields/associative
2023-10-04T17:55:51.461491+00:00 app[web.1]: bundler: failed to load command: puma (/app/vendor/bundle/ruby/3.1.0/bin/puma)
2023-10-04T17:55:51.465686+00:00 app[web.1]: /app/app/fields/has_many.rb:1:in `require_relative': cannot load such file -- /app/app/fields/associative (LoadError)
2023-10-04T17:55:51.465687+00:00 app[web.1]: from /app/app/fields/has_many.rb:1:in `<main>'
2023-10-04T17:55:51.465688+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-10-04T17:55:51.465689+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-10-04T17:55:51.465690+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:30:in `require'
2023-10-04T17:55:51.465690+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
2023-10-04T17:55:51.465691+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:135:in `cget'
2023-10-04T17:55:51.465691+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:175:in `block in actual_eager_load_dir'
2023-10-04T17:55:51.465691+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
2023-10-04T17:55:51.465691+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:25:in `each'
2023-10-04T17:55:51.465692+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:25:in `ls'
2023-10-04T17:55:51.465692+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:170:in `actual_eager_load_dir'
2023-10-04T17:55:51.465692+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
2023-10-04T17:55:51.465693+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:16:in `each'
2023-10-04T17:55:51.465693+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
2023-10-04T17:55:51.465693+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
2023-10-04T17:55:51.465693+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
2023-10-04T17:55:51.465694+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:379:in `block in eager_load_all'
2023-10-04T17:55:51.465694+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:377:in `each'
2023-10-04T17:55:51.465697+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:377:in `eager_load_all'
2023-10-04T17:55:51.465697+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
2023-10-04T17:55:51.465697+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `instance_exec'
2023-10-04T17:55:51.465698+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `run'
2023-10-04T17:55:51.465698+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:61:in `block in run_initializers'
2023-10-04T17:55:51.465698+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
2023-10-04T17:55:51.465698+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2023-10-04T17:55:51.465699+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
2023-10-04T17:55:51.465699+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
2023-10-04T17:55:51.465699+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each'
2023-10-04T17:55:51.465700+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `call'
2023-10-04T17:55:51.465700+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
2023-10-04T17:55:51.465700+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
2023-10-04T17:55:51.465700+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
2023-10-04T17:55:51.465700+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:60:in `run_initializers'
2023-10-04T17:55:51.465701+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application.rb:372:in `initialize!'
2023-10-04T17:55:51.465701+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2023-10-04T17:55:51.465701+00:00 app[web.1]: from config.ru:3:in `require_relative'
2023-10-04T17:55:51.465702+00:00 app[web.1]: from config.ru:3:in `block in <main>'
2023-10-04T17:55:51.465702+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/builder.rb:116:in `eval'
2023-10-04T17:55:51.465702+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/builder.rb:116:in `new_from_string'
2023-10-04T17:55:51.465703+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/builder.rb:105:in `load_file'
2023-10-04T17:55:51.465706+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/builder.rb:66:in `parse_file'
2023-10-04T17:55:51.465707+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.6/lib/puma/configuration.rb:348:in `load_rackup'
2023-10-04T17:55:51.465707+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.6/lib/puma/configuration.rb:270:in `app'
2023-10-04T17:55:51.465707+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.6/lib/puma/runner.rb:150:in `load_and_bind'
2023-10-04T17:55:51.465707+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.6/lib/puma/cluster.rb:357:in `run'
2023-10-04T17:55:51.465707+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.6/lib/puma/launcher.rb:193:in `run'
2023-10-04T17:55:51.465708+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.6/lib/puma/cli.rb:81:in `run'
2023-10-04T17:55:51.465708+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.6/bin/puma:10:in `<top (required)>'
2023-10-04T17:55:51.465708+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/bin/puma:25:in `load'
2023-10-04T17:55:51.465708+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/bin/puma:25:in `<top (required)>'
2023-10-04T17:55:51.465708+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `load'
2023-10-04T17:55:51.465709+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `kernel_load'
2023-10-04T17:55:51.465709+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli/exec.rb:23:in `run'
2023-10-04T17:55:51.465709+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli.rb:486:in `exec'
2023-10-04T17:55:51.465709+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
2023-10-04T17:55:51.465709+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
2023-10-04T17:55:51.465710+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
2023-10-04T17:55:51.465710+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
2023-10-04T17:55:51.465710+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
2023-10-04T17:55:51.465710+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'
2023-10-04T17:55:51.465711+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/libexec/bundle:48:in `block in <top (required)>'
2023-10-04T17:55:51.465711+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/bundler/friendly_errors.rb:120:in `with_friendly_errors'
2023-10-04T17:55:51.465711+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/libexec/bundle:36:in `<top (required)>'
2023-10-04T17:55:51.465711+00:00 app[web.1]: from /app/bin/bundle:108:in `load'
2023-10-04T17:55:51.465712+00:00 app[web.1]: from /app/bin/bundle:108:in `<main>'
2023-10-04T17:55:51.668129+00:00 heroku[web.1]: Process exited with status 1
2023-10-04T17:55:51.710865+00:00 heroku[web.1]: State changed from starting to crashed
2023-10-04T21:43:57.704502+00:00 app[api]: Starting process with command `rails c` by user flare.marionette@gmail.com
2023-10-04T21:44:06.279392+00:00 heroku[run.5381]: State changed from starting to up
2023-10-04T21:44:13.271369+00:00 heroku[run.5381]: Process exited with status 1
2023-10-04T21:44:13.320354+00:00 heroku[run.5381]: State changed from up to complete
2023-10-04T21:47:04.058954+00:00 app[api]: Starting process with command `rails c` by user flare.marionette@gmail.com
2023-10-04T21:47:11.066752+00:00 heroku[run.9112]: State changed from starting to up
2023-10-04T21:47:16.127248+00:00 heroku[run.9112]: Process exited with status 1
2023-10-04T21:47:16.151895+00:00 heroku[run.9112]: State changed from up to complete

設定ファイル等は下記のとおりです。

config.ru
# This file is used by Rack-based servers to start the application.

require_relative "config/environment"

run Rails.application
Rails.application.load_server
Gemfile
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "3.1.4"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.8"

# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem "sprockets-rails"

# Use mysql2 as the database for Active Record

# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 5.0"

# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem "importmap-rails"

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem "jbuilder"

# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"

# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
gem "bcrypt", "~> 3.1.7"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]

# Use Sass to process CSS
gem "sassc-rails"

# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

group :development, :test do
  # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
  gem "debug", platforms: %i[ mri mingw x64_mingw ]
end

group :development do
  # Use console on exceptions pages [https://github.com/rails/web-console]
  gem "web-console"
  gem "meta_request"

  # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
  # gem "rack-mini-profiler"

  # Speed up commands on slow machines / big apps [https://github.com/rails/spring]
  # gem "spring"
end

group :test do
  # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
  gem "capybara"
  gem "selenium-webdriver"
  gem "webdrivers"
end

gem "dartsass-rails", "~> 0.5.0"
gem 'bootsnap'
gem 'font-awesome-sass'
gem 'font-awesome-rails'
gem 'sorcery'
gem 'rails-i18n'
gem "turbo-rails"
gem "stimulus-rails"
gem "jquery-rails"
gem 'draper'
gem 'dotenv-rails'
gem 'ransack'
gem "cssbundling-rails"
gem "administrate"
gem 'administrate_ransack'
gem 'ransack'
gem 'enumerize'
gem 'administrate-field-nested_has_many'
gem 'administrate-field-belongs_to_search'
gem 'administrate-field-enumerize'
gem 'cocoon'
gem 'enum_help'
gem 'roo'
gem "mysql2"
gem 'kaminari'
gem 'net-imap'
gem 'net-pop'
gem 'net-smtp'
gem 'public_suffix'
gem 'matrix'
config/puma.rb
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
threads min_threads_count, max_threads_count

# Specifies the `worker_timeout` threshold that Puma will use to wait before
# terminating a worker in development environments.
#
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"

# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
#
port ENV.fetch("PORT") { 3000 }

# Specifies the `environment` that Puma will run in.
#
environment ENV.fetch("RAILS_ENV") { "development" }

# Specifies the `pidfile` that Puma will use.
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }

# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked web server processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
workers ENV.fetch("WEB_CONCURRENCY") { 2 }

# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory.
#
preload_app!

# Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart
database.yml
# MySQL. Versions 5.5.8 and up are supported.
#
# Install the MySQL driver
#   gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
#   gem "mysql2"
#
# And be sure to use new-style password hashing:
#   https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html
#
default: &default
  adapter: mysql2
  encoding: utf8mb4
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  username: root
  password: 
  host: localhost
  socket: /tmp/mysql.sock

development:
  <<: *default
  database: drug_app5_development

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *default
  database: drug_app5_test

# As with config/credentials.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password or a full connection URL as an environment
# variable when you boot the app. For example:
#
#   DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
#
# If the connection URL is provided in the special DATABASE_URL environment
# variable, Rails will automatically merge its configuration values on top of
# the values provided in this file. Alternatively, you can specify a connection
# URL environment variable explicitly:
#
#   production:
#     url: <%= ENV["MY_APP_DATABASE_URL"] %>
#
# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full overview on how database connection configuration can be specified.
#
production:
  <<: *default
  database: drug_app5_production
  username: drug_app5
  password: <%= ENV["DRUG_APP5_DATABASE_PASSWORD"] %>

ちなみに、bin/devでサーバーは問題なく立ち上げられます。

# anago @ flarenoMacbook-Air in ~/workspace/runteq/応用編/drug_app5 on git:searchform x [6:34:41] C:1
$ bin/dev
Installing foreman...
Fetching foreman-0.87.2.gem
Successfully installed foreman-0.87.2
1 gem installed
06:39:08 web.1  | started with pid 46649
06:39:08 css.1  | started with pid 46650
06:39:08 css.1  | started with pid 46651
06:39:08 css.1  | yarn run v1.22.19
06:39:08 css.1  | $ sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css --watch
06:39:09 css.1  | Sass is watching for changes. Press Ctrl-C to stop.
06:39:09 css.1  | 
06:39:09 web.1  | => Booting Puma
06:39:09 web.1  | => Rails 7.0.8 application starting in development 
06:39:09 web.1  | => Run `bin/rails server --help` for more startup options
06:39:10 web.1  | [46649] Puma starting in cluster mode...
06:39:10 web.1  | [46649] * Puma version: 5.6.6 (ruby 3.1.4-p223) ("Birdie's Version")
06:39:10 web.1  | [46649] *  Min threads: 5
06:39:10 web.1  | [46649] *  Max threads: 5
06:39:10 web.1  | [46649] *  Environment: development
06:39:10 web.1  | [46649] *   Master PID: 46649
06:39:10 web.1  | [46649] *      Workers: 2
06:39:10 web.1  | [46649] *     Restarts: (✔) hot (✖) phased
06:39:10 web.1  | [46649] * Preloading application
06:39:10 web.1  | [46649] * Listening on http://127.0.0.1:3000
06:39:10 web.1  | [46649] * Listening on http://[::1]:3000
06:39:10 web.1  | [46649] Use Ctrl-C to stop
06:39:10 web.1  | [46649] - Worker 0 (PID: 46666) booted in 0.0s, phase: 0
06:39:10 web.1  | [46649] - Worker 1 (PID: 46667) booted in 0.0s, phase: 0
06:39:11 css.1  | [2023-10-05 06:39:11] Compiled app/assets/stylesheets/application.scss to app/assets/builds/application.css.
06:39:11 css.1  | Sass is watching for changes. Press Ctrl-C to stop.
tmtkzk0823 commented 1 year ago

/app/app/fields/has_many.rb:1:in require_relative': cannot load such file -- /app/app/fields/associative (LoadError) のようなエラーが出ているのですが、ご自身のアプリにこのようなファイルはありますでしょうか?

CarbazochromeT commented 1 year ago

has_many.rbはAdministrateに関連するアプリです。 /app/app/fields/has_many.rb:1:in require_relative': cannot load such file -- /app/app/fields/associative (LoadError)` エラー文を見て、このファイルが不要なのかと思い、一回消してしまっていましたが、復活させてみて、herokuにpushしました。 しかし、push時にエラーが発生してしまいました。 Procfile周りでもエラーが発生してしまっているようです。

$ git push heroku searchform:main
Enumerating objects: 121, done.
Counting objects: 100% (121/121), done.
Delta compression using up to 8 threads
Compressing objects: 100% (69/69), done.
Writing objects: 100% (72/72), 7.15 KiB | 3.57 MiB/s, done.
Total 72 (delta 52), reused 0 (delta 0), pack-reused 0
remote: Updated 18813 paths from d0207600
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/ruby
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.3.25
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-3.1.4
remote: -----> Installing dependencies using bundler 2.3.25
remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote:        Your Gemfile lists the gem ransack (>= 0) more than once.
remote:        You should probably keep only one of them.
remote:        Remove any duplicate entries and specify the gem only once.
remote:        While it's not a problem now, it could cause errors if you change the version of one of them later.
remote:        Fetching gem metadata from https://rubygems.org/.........
remote:        Using rake 13.0.6
remote:        Using concurrent-ruby 1.2.2
remote:        Using minitest 5.20.0
remote:        Using builder 3.2.4
remote:        Using erubi 1.12.0
remote:        Using racc 1.7.1
remote:        Using crass 1.0.6
remote:        Using rack 2.2.8
remote:        Using nio4r 2.5.9
remote:        Using websocket-extensions 0.1.5
remote:        Using marcel 1.0.2
remote:        Using mini_mime 1.1.5
remote:        Using timeout 0.4.0
remote:        Using date 3.3.3
remote:        Using method_source 1.0.0
remote:        Using thor 1.2.2
remote:        Using zeitwerk 2.6.12
remote:        Using kaminari-core 1.2.2
remote:        Using ffi 1.15.5
remote:        Using tilt 2.2.0
remote:        Using selectize-rails 0.12.6
remote:        Using bundler 2.3.26
remote:        Using cocoon 1.2.15
remote:        Using bcrypt 3.1.19
remote:        Using msgpack 1.7.2
remote:        Using google-protobuf 3.23.4 (x86_64-linux)
remote:        Using dotenv 2.8.1
remote:        Using ruby2_keywords 0.0.5
remote:        Using faraday-net_http 3.0.2
remote:        Using hashie 5.0.0
remote:        Using jwt 2.7.1
remote:        Fetching matrix 0.4.2
remote:        Using multi_xml 0.6.0
remote:        Using mysql2 0.5.5
remote:        Using version_gem 1.1.3
remote:        Using public_suffix 5.0.3
remote:        Using rubyzip 2.3.2
remote:        Using i18n 1.14.1
remote:        Using tzinfo 2.0.6
remote:        Using nokogiri 1.15.4 (x86_64-linux)
remote:        Using rack-test 2.1.0
remote:        Using websocket-driver 0.7.6
remote:        Using sprockets 4.2.0
remote:        Using request_store 1.5.1
remote:        Using puma 5.6.6
remote:        Using net-protocol 0.2.1
remote:        Using sassc 2.4.0
remote:        Using activesupport 7.0.8
remote:        Using loofah 2.21.3
remote:        Using bootsnap 1.16.0
remote:        Using sass-embedded 1.64.2 (x86_64-linux-gnu)
remote:        Using faraday 2.7.10
remote:        Using oauth-tty 1.0.5
remote:        Using snaky_hash 2.0.1
remote:        Using roo 2.10.0
remote:        Using rails-dom-testing 2.2.0
remote:        Using rails-html-sanitizer 1.6.0
remote:        Using globalid 1.2.1
remote:        Using activemodel 7.0.8
remote:        Using net-imap 0.3.7
remote:        Using net-pop 0.1.2
remote:        Using net-smtp 0.4.0
remote:        Using enumerize 2.7.0
remote:        Using enum_help 0.0.19
remote:        Using font-awesome-sass 6.4.2
remote:        Using actionview 7.0.8
remote:        Using activejob 7.0.8
remote:        Using activerecord 7.0.8
remote:        Using mail 2.8.1
remote:        Using activemodel-serializers-xml 1.0.2
remote:        Using oauth 1.1.0
remote:        Using oauth2 2.0.9
remote:        Using kaminari-actionview 1.2.2
remote:        Using jbuilder 2.11.5
remote:        Using sorcery 0.16.5
remote:        Using actionpack 7.0.8
remote:        Using actioncable 7.0.8
remote:        Using actionmailer 7.0.8
remote:        Using railties 7.0.8
remote:        Using sprockets-rails 3.4.2
remote:        Using draper 4.0.2
remote:        Using activestorage 7.0.8
remote:        Using kaminari-activerecord 1.2.2
remote:        Using ransack 2.6.0
remote:        Using actiontext 7.0.8
remote:        Using actionmailbox 7.0.8
remote:        Using kaminari 1.2.2
remote:        Using jquery-rails 4.6.0
remote:        Using sassc-rails 2.1.2
remote:        Using cssbundling-rails 1.2.0
remote:        Using dartsass-rails 0.5.0
remote:        Using font-awesome-rails 4.7.0.8
remote:        Using importmap-rails 1.2.1
remote:        Using rails-i18n 7.0.7
remote:        Using stimulus-rails 1.2.2
remote:        Using turbo-rails 1.4.0
remote:        Using rails 7.0.8
remote:        Using dotenv-rails 2.8.1
remote:        Using administrate 0.19.0
remote:        Using administrate-field-belongs_to_search 0.8.0
remote:        Using administrate-field-enumerize 1.0.0
remote:        Using administrate-field-nested_has_many 1.3.0
remote:        Using administrate_ransack 0.5.1
remote:        Installing matrix 0.4.2
remote:        Bundle complete! 44 Gemfile dependencies, 103 gems now installed.
remote:        Gems in the groups 'development' and 'test' were not installed.
remote:        Bundled gems are installed into `./vendor/bundle`
remote:        Bundle completed (3.09s)
remote:        Cleaning up the bundler cache.
remote:        Removing bundler (2.3.25)
remote: -----> Installing node-v16.18.1-linux-x64
remote: -----> Installing yarn-v1.22.19
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        yarn install v1.22.19
remote:        [1/4] Resolving packages...
remote:        [2/4] Fetching packages...
remote:        [3/4] Linking dependencies...
remote:        [4/4] Building fresh packages...
remote:        Done in 1.45s.
remote:        yarn run v1.22.19
remote:        $ sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css
remote:        Done in 0.51s.
remote:        I, [2023-10-06T00:25:12.397066 #283]  INFO -- : Writing /tmp/build_7ee22c02/public/assets/application-ca5af75edc1aa2778cbdc60372c4d18899cd9ff8fe397262c090bbd395f83a5c.css
remote:        I, [2023-10-06T00:25:12.397217 #283]  INFO -- : Writing /tmp/build_7ee22c02/public/assets/application-ca5af75edc1aa2778cbdc60372c4d18899cd9ff8fe397262c090bbd395f83a5c.css.gz
remote:        I, [2023-10-06T00:25:12.399259 #283]  INFO -- : Writing /tmp/build_7ee22c02/public/assets/application.css-06e6345c11b8b071aa6a93118eabb8923fbff48acc9390731cdffbcd227beeab.map
remote:        Asset precompilation completed (4.38s)
remote:        Cleaning assets
remote:        Running: rake assets:clean
remote: -----> Detecting rails configuration
remote: 
remote: ###### WARNING:
remote: 
remote:        Removing `vendor/bundle`.
remote:        Checking in `vendor/bundle` is not supported. Please remove this directory
remote:        and add it to your .gitignore. To vendor your gems with Bundler, use
remote:        `bundle pack` instead.
remote: 
remote: ###### WARNING:
remote: 
remote:        Detecting rails configuration failed
remote:        set HEROKU_DEBUG_RAILS_RUNNER=1 to debug
remote: 
remote: 
remote: -----> Discovering process types
remote: 
remote:  !     Push failed: cannot parse Procfile.
remote:  !     Please try pushing again.
remote:  !     If the problem persists, see https://help.heroku.com/ and provide Request ID e39f3640-4613-288c-e79d-8e7bd183e8af.
remote: 
remote: 
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 95dbaa3c85614801b34cd50dd74d4ea91ccce0ac
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 95dbaa3c85614801b34cd50dd74d4ea91ccce0ac
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote: 
remote: Verifying deploy...
remote: 
remote: !       Push rejected to care-drug-searcher.
remote: 
To https://git.heroku.com/care-drug-searcher.git
 ! [remote rejected]   searchform -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/care-drug-searcher.git'

# anago @ flarenoMacbook-Air in ~/workspace/runteq/応用編/drug_app5 on git:searchform x [9:25:14] C:1

has_many.rbの中身はこのような形です。

require_relative "associative"
require "administrate/page/collection"
require "administrate/order"

module Administrate
  module Field
    class HasMany < Associative
      DEFAULT_LIMIT = 5

      def self.permitted_attribute(attr, _options = {})
        # This may seem arbitrary, and improvable by using reflection.
        # Worry not: here we do exactly what Rails does. Regardless of the name
        # of the foreign key, has_many associations use the suffix `_ids`
        # for this.
        #
        # Eg: if the associated table and primary key are `countries.code`,
        # you may expect `country_codes` as attribute here, but it will
        # be `country_ids` instead.
        #
        # See https://github.com/rails/rails/blob/b30a23f53b52e59d31358f7b80385ee5c2ba3afe/activerecord/lib/active_record/associations/builder/collection_association.rb#L48
        { "#{attr.to_s.singularize}_ids".to_sym => [] }
      end

      def associated_collection(order = self.order)
        Administrate::Page::Collection.new(
          associated_dashboard,
          order: order,
          collection_attributes: options[:collection_attributes],
        )
      end

      def attribute_key
        permitted_attribute.keys.first
      end

      def associated_resource_options
        candidate_resources.map do |associated_resource|
          [
            display_candidate_resource(associated_resource),
            associated_resource.send(association_primary_key),
          ]
        end
      end

      def selected_options
        return if data.empty?

        data.map { |object| object.send(association_primary_key) }
      end

      def limit
        options.fetch(:limit, DEFAULT_LIMIT)
      end

      def paginate?
        limit.respond_to?(:positive?) ? limit.positive? : limit.present?
      end

      def permitted_attribute
        self.class.permitted_attribute(
          attribute,
          resource_class: resource.class,
        )
      end

      def resources(page = 1, order = self.order)
        resources = order.apply(data)
        if paginate?
          resources = resources.page(page).per(limit)
        end
        includes.any? ? resources.includes(*includes) : resources
      end

      def more_than_limit?
        paginate? && data.count(:all) > limit
      end

      def data
        @data ||= associated_class.none
      end

      def order_from_params(params)
        Administrate::Order.new(
          params.fetch(:order, sort_by),
          params.fetch(:direction, direction),
        )
      end

      def order
        @order ||= Administrate::Order.new(sort_by, direction)
      end

      private

      def includes
        associated_dashboard.collection_includes
      end

      def candidate_resources
        if options.key?(:includes)
          includes = options.fetch(:includes)
          associated_class.includes(*includes).all
        else
          associated_class.all
        end
      end

      def display_candidate_resource(resource)
        associated_dashboard.display_resource(resource)
      end

      def sort_by
        options[:sort_by]
      end

      def direction
        options[:direction]
      end
    end
  end
end
tmtkzk0823 commented 1 year ago

こちらの記事が参考になりそうです。

CarbazochromeT commented 1 year ago

Procfileの中身を書き直しました。

release: bundle exec rails db:migrate
web: bundle exec rails server -p $PORT -e $RAILS_ENV

そして、教えていただいた記事を参考に、heroku configの設定も変えました。

$ heroku config:set DISABLE_COLLECTSTATIC=1
Setting DISABLE_COLLECTSTATIC and restarting ⬢ care-drug-searcher... done, v9
DISABLE_COLLECTSTATIC: 1

データベースのマイグレーションが関係あるのかと思い、マイグレーションを行おうとしたらエラーが発生してしまいます。

# anago @ flarenoMacbook-Air in ~/workspace/runteq/応用編/drug_app5 on git:searchform x [15:58:37] 
$ heroku run bundle exec rake db:migrate   
Running bundle exec rake db:migrate on ⬢ care-drug-searcher... up, run.5062 (Basic)
rake aborted!
ActiveRecord::ConnectionNotEstablished: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/mysql2_adapter.rb:53:in `rescue in new_client'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/mysql2_adapter.rb:43:in `new_client'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/mysql2_adapter.rb:23:in `mysql2_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_handling.rb:280:in `connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/tasks/database_tasks.rb:262:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/railties/databases.rake:92:in `block (2 levels) in <main>'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/app/bin/bundle:108:in `load'
/app/bin/bundle:108:in `<main>'

Caused by:
Mysql2::Error::ConnectionError: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:97:in `connect'
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:97:in `initialize'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/mysql2_adapter.rb:44:in `new'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/mysql2_adapter.rb:44:in `new_client'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/mysql2_adapter.rb:23:in `mysql2_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_handling.rb:280:in `connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/tasks/database_tasks.rb:262:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/railties/databases.rake:92:in `block (2 levels) in <main>'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/app/bin/bundle:108:in `load'
/app/bin/bundle:108:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

また、依然としてProcfileとHEROKU_DEBUG_RAILS_RUNNER=1 に関するエラーも発生してしまいます。

# anago @ flarenoMacbook-Air in ~/workspace/runteq/応用編/drug_app5 on git:searchform x [15:59:06] 
$ git push heroku searchform:main          
Enumerating objects: 121, done.
Counting objects: 100% (121/121), done.
Delta compression using up to 8 threads
Compressing objects: 100% (69/69), done.
Writing objects: 100% (72/72), 7.15 KiB | 3.57 MiB/s, done.
Total 72 (delta 52), reused 0 (delta 0), pack-reused 0
remote: Updated 18813 paths from d0207600
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpacks:
remote:        1. https://github.com/heroku/heroku-buildpack-activestorage-preview
remote:        2. heroku/ruby
remote: -----> ActiveStorage Preview app detected
remote: -----> Installing binary dependencies for ActiveStorage Preview
remote:        Downloading ffmpeg version 5.1.2
remote:        Installing ffmpeg
remote:        Done
remote:        Exporting environment variables
remote:        Done
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.3.25
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-3.1.4
remote: -----> Installing dependencies using bundler 2.3.25
remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote:        Your Gemfile lists the gem ransack (>= 0) more than once.
remote:        You should probably keep only one of them.
remote:        Remove any duplicate entries and specify the gem only once.
remote:        While it's not a problem now, it could cause errors if you change the version of one of them later.
remote:        Fetching gem metadata from https://rubygems.org/.........
remote:        Using rake 13.0.6
remote:        Using concurrent-ruby 1.2.2
remote:        Using minitest 5.20.0
remote:        Using builder 3.2.4
remote:        Using racc 1.7.1
remote:        Using crass 1.0.6
remote:        Using rack 2.2.8
remote:        Using nio4r 2.5.9
remote:        Using websocket-extensions 0.1.5
remote:        Using marcel 1.0.2
remote:        Using mini_mime 1.1.5
remote:        Using date 3.3.3
remote:        Using timeout 0.4.0
remote:        Using method_source 1.0.0
remote:        Using thor 1.2.2
remote:        Using zeitwerk 2.6.12
remote:        Using kaminari-core 1.2.2
remote:        Using ffi 1.15.5
remote:        Using tilt 2.2.0
remote:        Using erubi 1.12.0
remote:        Using bundler 2.3.26
remote:        Using selectize-rails 0.12.6
remote:        Using cocoon 1.2.15
remote:        Using bcrypt 3.1.19
remote:        Using msgpack 1.7.2
remote:        Using google-protobuf 3.23.4 (x86_64-linux)
remote:        Using dotenv 2.8.1
remote:        Using ruby2_keywords 0.0.5
remote:        Using faraday-net_http 3.0.2
remote:        Using hashie 5.0.0
remote:        Using jwt 2.7.1
remote:        Fetching matrix 0.4.2
remote:        Using multi_xml 0.6.0
remote:        Using mysql2 0.5.5
remote:        Using version_gem 1.1.3
remote:        Using public_suffix 5.0.3
remote:        Using rubyzip 2.3.2
remote:        Using i18n 1.14.1
remote:        Using tzinfo 2.0.6
remote:        Using nokogiri 1.15.4 (x86_64-linux)
remote:        Using rack-test 2.1.0
remote:        Using websocket-driver 0.7.6
remote:        Using net-protocol 0.2.1
remote:        Using sassc 2.4.0
remote:        Using sprockets 4.2.0
remote:        Using request_store 1.5.1
remote:        Using puma 5.6.6
remote:        Using loofah 2.21.3
remote:        Using net-imap 0.3.7
remote:        Using net-pop 0.1.2
remote:        Using bootsnap 1.16.0
remote:        Using sass-embedded 1.64.2 (x86_64-linux-gnu)
remote:        Using faraday 2.7.10
remote:        Using font-awesome-sass 6.4.2
remote:        Using oauth-tty 1.0.5
remote:        Using net-smtp 0.4.0
remote:        Using snaky_hash 2.0.1
remote:        Using roo 2.10.0
remote:        Using activesupport 7.0.8
remote:        Using rails-html-sanitizer 1.6.0
remote:        Using rails-dom-testing 2.2.0
remote:        Using globalid 1.2.1
remote:        Using activemodel 7.0.8
remote:        Using mail 2.8.1
remote:        Using enumerize 2.7.0
remote:        Using enum_help 0.0.19
remote:        Using oauth 1.1.0
remote:        Using oauth2 2.0.9
remote:        Using actionview 7.0.8
remote:        Using activejob 7.0.8
remote:        Using activerecord 7.0.8
remote:        Using activemodel-serializers-xml 1.0.2
remote:        Using sorcery 0.16.5
remote:        Using actionpack 7.0.8
remote:        Using kaminari-actionview 1.2.2
remote:        Using kaminari-activerecord 1.2.2
remote:        Using jbuilder 2.11.5
remote:        Using ransack 2.6.0
remote:        Using actioncable 7.0.8
remote:        Using activestorage 7.0.8
remote:        Using actionmailer 7.0.8
remote:        Using railties 7.0.8
remote:        Using kaminari 1.2.2
remote:        Using sprockets-rails 3.4.2
remote:        Using draper 4.0.2
remote:        Using actionmailbox 7.0.8
remote:        Using actiontext 7.0.8
remote:        Using sassc-rails 2.1.2
remote:        Using jquery-rails 4.6.0
remote:        Using rails 7.0.8
remote:        Using cssbundling-rails 1.2.0
remote:        Using dartsass-rails 0.5.0
remote:        Using dotenv-rails 2.8.1
remote:        Using font-awesome-rails 4.7.0.8
remote:        Using importmap-rails 1.2.1
remote:        Using rails-i18n 7.0.7
remote:        Using stimulus-rails 1.2.2
remote:        Using turbo-rails 1.4.0
remote:        Using administrate 0.19.0
remote:        Using administrate-field-belongs_to_search 0.8.0
remote:        Using administrate-field-enumerize 1.0.0
remote:        Using administrate-field-nested_has_many 1.3.0
remote:        Using administrate_ransack 0.5.1
remote:        Installing matrix 0.4.2
remote:        Bundle complete! 44 Gemfile dependencies, 103 gems now installed.
remote:        Gems in the groups 'development' and 'test' were not installed.
remote:        Bundled gems are installed into `./vendor/bundle`
remote:        Bundle completed (2.55s)
remote:        Cleaning up the bundler cache.
remote:        Removing bundler (2.3.25)
remote: -----> Installing node-v16.18.1-linux-x64
remote: -----> Installing yarn-v1.22.19
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        yarn install v1.22.19
remote:        [1/4] Resolving packages...
remote:        [2/4] Fetching packages...
remote:        [3/4] Linking dependencies...
remote:        [4/4] Building fresh packages...
remote:        Done in 2.10s.
remote:        yarn run v1.22.19
remote:        $ sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css
remote:        Done in 0.54s.
remote:        I, [2023-10-06T07:00:04.844780 #343]  INFO -- : Writing /tmp/build_bfae2e9b/public/assets/application-ca5af75edc1aa2778cbdc60372c4d18899cd9ff8fe397262c090bbd395f83a5c.css
remote:        I, [2023-10-06T07:00:04.844952 #343]  INFO -- : Writing /tmp/build_bfae2e9b/public/assets/application-ca5af75edc1aa2778cbdc60372c4d18899cd9ff8fe397262c090bbd395f83a5c.css.gz
remote:        I, [2023-10-06T07:00:04.847241 #343]  INFO -- : Writing /tmp/build_bfae2e9b/public/assets/application.css-06e6345c11b8b071aa6a93118eabb8923fbff48acc9390731cdffbcd227beeab.map
remote:        Asset precompilation completed (5.14s)
remote:        Cleaning assets
remote:        Running: rake assets:clean
remote: -----> Detecting rails configuration
remote: 
remote: ###### WARNING:
remote: 
remote:        Removing `vendor/bundle`.
remote:        Checking in `vendor/bundle` is not supported. Please remove this directory
remote:        and add it to your .gitignore. To vendor your gems with Bundler, use
remote:        `bundle pack` instead.
remote: 
remote: ###### WARNING:
remote: 
remote:        Detecting rails configuration failed
remote:        set HEROKU_DEBUG_RAILS_RUNNER=1 to debug
remote: 
remote: 
remote: -----> Discovering process types
remote: 
remote:  !     Push failed: cannot parse Procfile.
remote:  !     Please try pushing again.
remote:  !     If the problem persists, see https://help.heroku.com/ and provide Request ID 3696375a-9db2-e7ee-094d-e7d7da4e784d.
remote: 
remote: 
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 95dbaa3c85614801b34cd50dd74d4ea91ccce0ac
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 95dbaa3c85614801b34cd50dd74d4ea91ccce0ac
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote: 
remote: Verifying deploy...
remote: 
remote: !       Push rejected to care-drug-searcher.
remote: 
To https://git.heroku.com/care-drug-searcher.git
 ! [remote rejected]   searchform -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/care-drug-searcher.git'
Tsuchiya2 commented 1 year ago

そもそもの確認ですか、herokuはpostgresqlがデフォルメですが、アドオンでmysqlが使用できるようになっていますでしょうか?またGemfile・datadase.ymlは適切なものになっていますでしょうか?

またherokuはデータベースも有料化になりましたが、其辺の対応もお済みでしょうか?

CarbazochromeT commented 1 year ago

すみません、Herokuでのアドオンの設定を失念しておりました。

今は、エラーメッセージが出るものの、pushはできるようになりました。

$ git push heroku deploy:main
Enumerating objects: 44, done.
Counting objects: 100% (44/44), done.
Delta compression using up to 8 threads
Compressing objects: 100% (22/22), done.
Writing objects: 100% (26/26), 2.93 KiB | 2.93 MiB/s, done.
Total 26 (delta 14), reused 2 (delta 0), pack-reused 0
remote: Updated 18753 paths from 8f5264b9
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpacks:
remote:        1. https://github.com/heroku/heroku-buildpack-activestorage-preview
remote:        2. heroku/ruby
remote: -----> ActiveStorage Preview app detected
remote: -----> Installing binary dependencies for ActiveStorage Preview
remote:        Downloading ffmpeg version 5.1.2
remote:        Installing ffmpeg
remote:        Done
remote:        Exporting environment variables
remote:        Done
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.3.25
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-3.1.4
remote: -----> Installing dependencies using bundler 2.3.25
remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote:        Your Gemfile lists the gem ransack (>= 0) more than once.
remote:        You should probably keep only one of them.
remote:        Remove any duplicate entries and specify the gem only once.
remote:        While it's not a problem now, it could cause errors if you change the version of one of them later.
remote:        Using rake 13.0.6
remote:        Using concurrent-ruby 1.2.2
remote:        Using i18n 1.14.1
remote:        Using minitest 5.20.0
remote:        Using tzinfo 2.0.6
remote:        Using activesupport 7.0.8
remote:        Using builder 3.2.4
remote:        Using erubi 1.12.0
remote:        Using racc 1.7.1
remote:        Using nokogiri 1.15.4 (x86_64-linux)
remote:        Using rails-dom-testing 2.2.0
remote:        Using crass 1.0.6
remote:        Using loofah 2.21.3
remote:        Using rails-html-sanitizer 1.6.0
remote:        Using actionview 7.0.8
remote:        Using rack 2.2.8
remote:        Using rack-test 2.1.0
remote:        Using actionpack 7.0.8
remote:        Using nio4r 2.5.9
remote:        Using websocket-extensions 0.1.5
remote:        Using websocket-driver 0.7.6
remote:        Using actioncable 7.0.8
remote:        Using globalid 1.2.1
remote:        Using activejob 7.0.8
remote:        Using activemodel 7.0.8
remote:        Using activerecord 7.0.8
remote:        Using marcel 1.0.2
remote:        Using mini_mime 1.1.5
remote:        Using activestorage 7.0.8
remote:        Using date 3.3.3
remote:        Using timeout 0.4.0
remote:        Using net-protocol 0.2.1
remote:        Using net-imap 0.3.7
remote:        Using net-pop 0.1.2
remote:        Using net-smtp 0.4.0
remote:        Using mail 2.8.1
remote:        Using actionmailbox 7.0.8
remote:        Using actionmailer 7.0.8
remote:        Using actiontext 7.0.8
remote:        Using activemodel-serializers-xml 1.0.2
remote:        Using method_source 1.0.0
remote:        Using thor 1.2.2
remote:        Using zeitwerk 2.6.12
remote:        Using railties 7.0.8
remote:        Using jquery-rails 4.6.0
remote:        Using kaminari-core 1.2.2
remote:        Using kaminari-actionview 1.2.2
remote:        Using kaminari-activerecord 1.2.2
remote:        Using kaminari 1.2.2
remote:        Using ffi 1.15.5
remote:        Using sassc 2.4.0
remote:        Using sprockets 4.2.0
remote:        Using sprockets-rails 3.4.2
remote:        Using tilt 2.2.0
remote:        Using sassc-rails 2.1.2
remote:        Using selectize-rails 0.12.6
remote:        Using administrate 0.19.0
remote:        Using jbuilder 2.11.5
remote:        Using bundler 2.3.26
remote:        Using rails 7.0.8
remote:        Using administrate-field-belongs_to_search 0.8.0
remote:        Using enumerize 2.7.0
remote:        Using administrate-field-enumerize 1.0.0
remote:        Using cocoon 1.2.15
remote:        Using administrate-field-nested_has_many 1.3.0
remote:        Using ransack 2.6.0
remote:        Using administrate_ransack 0.5.1
remote:        Using bcrypt 3.1.19
remote:        Using msgpack 1.7.2
remote:        Using bootsnap 1.16.0
remote:        Using cssbundling-rails 1.2.0
remote:        Using google-protobuf 3.23.4 (x86_64-linux)
remote:        Using sass-embedded 1.64.2 (x86_64-linux-gnu)
remote:        Using dartsass-rails 0.5.0
remote:        Using dotenv 2.8.1
remote:        Using dotenv-rails 2.8.1
remote:        Using request_store 1.5.1
remote:        Using ruby2_keywords 0.0.5
remote:        Using draper 4.0.2
remote:        Using enum_help 0.0.19
remote:        Using faraday-net_http 3.0.2
remote:        Using faraday 2.7.10
remote:        Using font-awesome-rails 4.7.0.8
remote:        Using font-awesome-sass 6.4.2
remote:        Using hashie 5.0.0
remote:        Using importmap-rails 1.2.1
remote:        Using json 2.6.3
remote:        Using jwt 2.7.1
remote:        Using matrix 0.4.2
remote:        Using multi_xml 0.6.0
remote:        Using mysql2 0.5.5
remote:        Using version_gem 1.1.3
remote:        Using oauth-tty 1.0.5
remote:        Using snaky_hash 2.0.1
remote:        Using oauth 1.1.0
remote:        Using oauth2 2.0.9
remote:        Using public_suffix 5.0.3
remote:        Using puma 5.6.6
remote:        Using rails-i18n 7.0.7
remote:        Using rakuten_web_service 1.13.2
remote:        Using rubyzip 2.3.2
remote:        Using roo 2.10.0
remote:        Using sorcery 0.16.5
remote:        Using squasher 0.7.2
remote:        Using stimulus-rails 1.2.2
remote:        Using turbo-rails 1.4.0
remote:        Bundle complete! 46 Gemfile dependencies, 106 gems now installed.
remote:        Gems in the groups 'development' and 'test' were not installed.
remote:        Bundled gems are installed into `./vendor/bundle`
remote:        Bundle completed (0.31s)
remote:        Cleaning up the bundler cache.
remote:        Removing bundler (2.3.25)
remote: -----> Installing node-v16.18.1-linux-x64
remote: -----> Installing yarn-v1.22.19
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        yarn install v1.22.19
remote:        [1/4] Resolving packages...
remote:        [2/4] Fetching packages...
remote:        [3/4] Linking dependencies...
remote:        [4/4] Building fresh packages...
remote:        Done in 1.43s.
remote:        yarn run v1.22.19
remote:        $ sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css
remote:        Done in 0.58s.
remote:        Asset precompilation completed (4.58s)
remote:        Cleaning assets
remote:        Running: rake assets:clean
remote: -----> Detecting rails configuration
remote: 
remote: ###### WARNING:
remote: 
remote:        Removing `vendor/bundle`.
remote:        Checking in `vendor/bundle` is not supported. Please remove this directory
remote:        and add it to your .gitignore. To vendor your gems with Bundler, use
remote:        `bundle pack` instead.
remote: 
remote: ###### WARNING:
remote: 
remote:        Detecting rails configuration failed
remote:        set HEROKU_DEBUG_RAILS_RUNNER=1 to debug
remote: 
remote: 
remote: -----> Discovering process types
remote:        Procfile declares types     -> release, web
remote:        Default types for buildpack -> console, rake
remote: 
remote: -----> Compressing...
remote:        Done: 146.1M
remote: -----> Launching...
remote:  !     Release command declared: this new release will not be available until the command succeeds.
remote:        Released v43
remote:        https://care-drug-searcher-10b9b1b1aa53.herokuapp.com/ deployed to Heroku
remote: 
remote: This app is using the Heroku-20 stack, however a newer stack is available.
remote: To upgrade to Heroku-22, see:
remote: https://devcenter.heroku.com/articles/upgrading-to-the-latest-stack
remote: 
remote: Verifying deploy... done.
remote: Running release command...
remote: 
remote: WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
remote: ============= WARNING FROM mysql2 =============
remote: The options :user, :pass, :hostname, :dbname, :db, and :sock are deprecated and will be removed at some point in the future.
remote: Instead, please use :username, :password, :host, :port, :database, :socket, :flags for the options.
remote: ============= END WARNING FROM mysql2 =========
remote: WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
remote: ============= WARNING FROM mysql2 =============
remote: The options :user, :pass, :hostname, :dbname, :db, and :sock are deprecated and will be removed at some point in the future.
remote: Instead, please use :username, :password, :host, :port, :database, :socket, :flags for the options.
remote: ============= END WARNING FROM mysql2 =========
remote: Waiting for release.... done.
To https://git.heroku.com/care-drug-searcher.git
   fdfef747..15fa6590  deploy -> main

現在はHerokuでのrailsの立ち上げを行おうとしております。 まず、マイグレーションでエラーが発生してしまいます。

$ heroku rake db:migrate
Running rake db:migrate on ⬢ care-drug-searcher... up, run.4331
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
============= WARNING FROM mysql2 =============
The options :user, :pass, :hostname, :dbname, :db, and :sock are deprecated and will be removed at some point in the future.
Instead, please use :username, :password, :host, :port, :database, :socket, :flags for the options.
============= END WARNING FROM mysql2 =========
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
============= WARNING FROM mysql2 =============
The options :user, :pass, :hostname, :dbname, :db, and :sock are deprecated and will be removed at some point in the future.
Instead, please use :username, :password, :host, :port, :database, :socket, :flags for the options.
============= END WARNING FROM mysql2 =========

そして、consoleの立ち上げがうまくいきません。

$ heroku run rails c                    
Running rails c on ⬢ care-drug-searcher... up, run.7012 (Basic)
/app/app/fields/base.rb:1:in `require_relative': cannot load such file -- /app/app/fields/deferred (LoadError)
        from /app/app/fields/base.rb:1:in `<main>'
        from /app/app/fields/associative.rb:1:in `require_relative'
        from /app/app/fields/associative.rb:1:in `<main>'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:30:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:135:in `cget'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:175:in `block in actual_eager_load_dir'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:25:in `each'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:25:in `ls'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:170:in `actual_eager_load_dir'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:16:in `each'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:379:in `block in eager_load_all'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:377:in `each'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:377:in `eager_load_all'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `instance_exec'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `run'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:61:in `block in run_initializers'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `call'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:60:in `run_initializers'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application.rb:372:in `initialize!'
        from /app/config/environment.rb:5:in `<main>'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application.rb:348:in `require_environment!'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/actions.rb:28:in `require_environment!'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/console/console_command.rb:105:in `perform'
        from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
        from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
        from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/base.rb:87:in `perform'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command.rb:48:in `invoke'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/bin/rails:4:in `<main>'

libディレクトリやvenderディレクトリ内にAdministrate関連のgem関連のファイルを入れておりますが、いくつか動かないものがったため、app/app内に入れているんですが、それがいけないのでしょうか? 元のderrerd.rbは下記のディレクトリに入っております。 drug_app5/vendor/bundle/ruby/3.0.0/gems/administrate-0.19.0/lib/administrate/field/deferred.rb drug_app5/vendor/bundle/ruby/3.1.0/gems/administrate-0.19.0/lib/administrate/field/deferred.rb drug_app5/app/fields/deferred.rb

ちなみに、app/app/fieldsというディレクトリ名をfieldに変更すると、また別のエラーが発生しました。

$ heroku run rails c         
Running rails c on ⬢ care-drug-searcher... up, run.4590 (Basic)
/app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/callbacks.rb:33:in `on_file_autoloaded': expected file /app/app/field/associative.rb to define constant Associative, but didn't (Zeitwerk::NameError)

      raise Zeitwerk::NameError.new(msg, cref.last)
      ^^^^^
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:31:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:135:in `cget'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:175:in `block in actual_eager_load_dir'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:25:in `each'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:25:in `ls'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:170:in `actual_eager_load_dir'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:16:in `each'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:379:in `block in eager_load_all'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:377:in `each'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:377:in `eager_load_all'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `instance_exec'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `run'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:61:in `block in run_initializers'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `call'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:60:in `run_initializers'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application.rb:372:in `initialize!'
        from /app/config/environment.rb:5:in `<main>'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application.rb:348:in `require_environment!'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/actions.rb:28:in `require_environment!'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/console/console_command.rb:105:in `perform'
        from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
        from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
        from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/base.rb:87:in `perform'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command.rb:48:in `invoke'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/bin/rails:4:in `<main>'
kenchasonakai commented 1 year ago

libディレクトリやvenderディレクトリ内にAdministrate関連のgem関連のファイルを入れておりますが、いくつか動かないものがったため、app/app内に入れているんですが、それがいけないのでしょうか?

基本的にgemのファイルはgitに含めないように管理しましょう vendorもgit管理しないファイルになります bundlerを使ったシンプルなgemの管理方法に修正しましょう

また、基本的なHerokuの利用ではProcfileを自分で作成、または編集することはほぼほぼないのでなにか特殊なことをしているかもですね

まずは基本的なRailsの構成に直してlocalで動かすことを目指して修正し、その後Herokuから一度アプリケーションを削除して再度デプロイしてみましょう

CarbazochromeT commented 1 year ago

vender/bundleへインストールすることをやめ、.gitignoreファイルでpushしないように設定いたしました。 その後、一度heroku内のアプリを削除し、デブロイの再設定を行ったのですが、まだエラーが出てしまいます。

$ heroku run rails c                    
Running rails c on ⬢ cryptic-dawn-77749... up, run.9931 (Basic)
/app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/callbacks.rb:33:in `on_file_autoloaded': expected file /app/app/field/associative.rb to define constant Associative, but didn't (Zeitwerk::NameError)

      raise Zeitwerk::NameError.new(msg, cref.last)
      ^^^^^
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:31:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:135:in `cget'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:175:in `block in actual_eager_load_dir'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:25:in `each'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:25:in `ls'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:170:in `actual_eager_load_dir'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:16:in `each'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:379:in `block in eager_load_all'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:377:in `each'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:377:in `eager_load_all'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `instance_exec'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `run'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:61:in `block in run_initializers'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `call'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
        from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:60:in `run_initializers'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application.rb:372:in `initialize!'
        from /app/config/environment.rb:5:in `<main>'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application.rb:348:in `require_environment!'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/actions.rb:28:in `require_environment!'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/console/console_command.rb:105:in `perform'
        from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
        from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
        from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/base.rb:87:in `perform'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command.rb:48:in `invoke'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /app/bin/rails:4:in `<main>'

# anago @ flarenoMacbook-Air in ~/workspace/runteq/応用編/drug_app5 on git:deploy o [15:28:45] 
$ heroku run rails db:migrate           
Running rails db:migrate on ⬢ cryptic-dawn-77749... up, run.7800 (Basic)
============= WARNING FROM mysql2 =============
The options :user, :pass, :hostname, :dbname, :db, and :sock are deprecated and will be removed at some point in the future.
Instead, please use :username, :password, :host, :port, :database, :socket, :flags for the options.
============= END WARNING FROM mysql2 =========
============= WARNING FROM mysql2 =============
The options :user, :pass, :hostname, :dbname, :db, and :sock are deprecated and will be removed at some point in the future.
Instead, please use :username, :password, :host, :port, :database, :socket, :flags for the options.
============= END WARNING FROM mysql2 =========
I, [2023-10-10T06:29:14.343100 #2]  INFO -- : Migrating to ChangePrimaryKey (20230909001430)
== 20230909001430 ChangePrimaryKey: migrating =================================
-- execute("ALTER TABLE your_table_name DROP PRIMARY KEY, ADD PRIMARY KEY (new_primary_key_column);")
rails aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Table 'qw7n2t3o8f78mknx.your_table_name' doesn't exist
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:151:in `_query'
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:151:in `block in query'
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:150:in `handle_interrupt'
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:150:in `query'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:638:in `block (2 levels) in raw_execute'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/dependencies/interlock.rb:41:in `permit_concurrent_loads'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:637:in `block in raw_execute'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:752:in `block in log'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:743:in `log'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:636:in `raw_execute'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/mysql/database_statements.rb:96:in `raw_execute'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/mysql/database_statements.rb:47:in `execute'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:965:in `block in method_missing'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:935:in `block in say_with_time'
/app/vendor/ruby-3.1.4/lib/ruby/3.1.0/benchmark.rb:296:in `measure'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:935:in `say_with_time'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:954:in `method_missing'
/app/db/migrate/20230909001430_change_primary_key.rb:3:in `change'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:905:in `exec_migration'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:889:in `block (2 levels) in migrate'
/app/vendor/ruby-3.1.4/lib/ruby/3.1.0/benchmark.rb:296:in `measure'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:888:in `block in migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in `with_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:887:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1095:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1409:in `block in execute_migration_in_transaction'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1462:in `ddl_transaction'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1408:in `execute_migration_in_transaction'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1382:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1382:in `migrate_without_lock'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1331:in `block in migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1481:in `block in with_advisory_lock'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in `with_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1496:in `with_advisory_lock_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1477:in `with_advisory_lock'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1331:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1166:in `up'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1141:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/tasks/database_tasks.rb:262:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/railties/databases.rake:92:in `block (2 levels) in <main>'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command.rb:51:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
/app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/app/bin/rails:4:in `<main>'

Caused by:
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'qw7n2t3o8f78mknx.your_table_name' doesn't exist
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:151:in `_query'
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:151:in `block in query'
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:150:in `handle_interrupt'
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:150:in `query'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:638:in `block (2 levels) in raw_execute'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/dependencies/interlock.rb:41:in `permit_concurrent_loads'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:637:in `block in raw_execute'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:752:in `block in log'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:743:in `log'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:636:in `raw_execute'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/mysql/database_statements.rb:96:in `raw_execute'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/mysql/database_statements.rb:47:in `execute'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:965:in `block in method_missing'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:935:in `block in say_with_time'
/app/vendor/ruby-3.1.4/lib/ruby/3.1.0/benchmark.rb:296:in `measure'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:935:in `say_with_time'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:954:in `method_missing'
/app/db/migrate/20230909001430_change_primary_key.rb:3:in `change'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:905:in `exec_migration'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:889:in `block (2 levels) in migrate'
/app/vendor/ruby-3.1.4/lib/ruby/3.1.0/benchmark.rb:296:in `measure'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:888:in `block in migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in `with_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:887:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1095:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1409:in `block in execute_migration_in_transaction'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1462:in `ddl_transaction'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1408:in `execute_migration_in_transaction'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1382:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1382:in `migrate_without_lock'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1331:in `block in migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1481:in `block in with_advisory_lock'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in `with_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1496:in `with_advisory_lock_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1477:in `with_advisory_lock'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1331:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1166:in `up'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1141:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/tasks/database_tasks.rb:262:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/railties/databases.rake:92:in `block (2 levels) in <main>'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command.rb:51:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
/app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/app/bin/rails:4:in `<main>'

Caused by:
Mysql2::Error: Table 'qw7n2t3o8f78mknx.your_table_name' doesn't exist
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:151:in `_query'
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:151:in `block in query'
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:150:in `handle_interrupt'
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:150:in `query'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:638:in `block (2 levels) in raw_execute'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/dependencies/interlock.rb:41:in `permit_concurrent_loads'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:637:in `block in raw_execute'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:752:in `block in log'
/app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:743:in `log'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:636:in `raw_execute'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/mysql/database_statements.rb:96:in `raw_execute'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/mysql/database_statements.rb:47:in `execute'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:965:in `block in method_missing'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:935:in `block in say_with_time'
/app/vendor/ruby-3.1.4/lib/ruby/3.1.0/benchmark.rb:296:in `measure'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:935:in `say_with_time'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:954:in `method_missing'
/app/db/migrate/20230909001430_change_primary_key.rb:3:in `change'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:905:in `exec_migration'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:889:in `block (2 levels) in migrate'
/app/vendor/ruby-3.1.4/lib/ruby/3.1.0/benchmark.rb:296:in `measure'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:888:in `block in migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in `with_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:887:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1095:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1409:in `block in execute_migration_in_transaction'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1462:in `ddl_transaction'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1408:in `execute_migration_in_transaction'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1382:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1382:in `migrate_without_lock'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1331:in `block in migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1481:in `block in with_advisory_lock'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in `with_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1496:in `with_advisory_lock_connection'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1477:in `with_advisory_lock'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1331:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1166:in `up'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1141:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/tasks/database_tasks.rb:262:in `migrate'
/app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/railties/databases.rake:92:in `block (2 levels) in <main>'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
/app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command.rb:51:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
/app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/app/bin/rails:4:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
$ heroku logs --tail
2023-10-10T06:28:43.759988+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
2023-10-10T06:28:43.759989+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
2023-10-10T06:28:43.759990+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
2023-10-10T06:28:43.759991+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/base.rb:87:in `perform'
2023-10-10T06:28:43.759992+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command.rb:48:in `invoke'
2023-10-10T06:28:43.759993+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
2023-10-10T06:28:43.759994+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-10-10T06:28:43.759995+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-10-10T06:28:43.759996+00:00 app[web.1]: from bin/rails:4:in `<main>'
2023-10-10T06:28:43.838650+00:00 heroku[web.1]: Process exited with status 1
2023-10-10T06:28:43.870499+00:00 heroku[web.1]: State changed from starting to crashed
2023-10-10T06:28:43.874150+00:00 heroku[web.1]: State changed from crashed to starting
2023-10-10T06:28:45.191361+00:00 heroku[run.9931]: Process exited with status 1
2023-10-10T06:28:45.220415+00:00 heroku[run.9931]: State changed from up to complete
2023-10-10T06:28:48.384655+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 6383 -e production`
2023-10-10T06:28:50.574023+00:00 app[web.1]: => Booting Puma
2023-10-10T06:28:50.574055+00:00 app[web.1]: => Rails 7.0.8 application starting in production
2023-10-10T06:28:50.574055+00:00 app[web.1]: => Run `bin/rails server --help` for more startup options
2023-10-10T06:28:51.023929+00:00 app[web.1]: Exiting
2023-10-10T06:28:51.024320+00:00 app[web.1]: /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/callbacks.rb:33:in `on_file_autoloaded': expected file /app/app/field/associative.rb to define constant Associative, but didn't (Zeitwerk::NameError)
2023-10-10T06:28:51.024321+00:00 app[web.1]: 
2023-10-10T06:28:51.024322+00:00 app[web.1]: raise Zeitwerk::NameError.new(msg, cref.last)
2023-10-10T06:28:51.024322+00:00 app[web.1]: ^^^^^
2023-10-10T06:28:51.024323+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:31:in `require'
2023-10-10T06:28:51.024324+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
2023-10-10T06:28:51.024324+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:135:in `cget'
2023-10-10T06:28:51.024325+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:175:in `block in actual_eager_load_dir'
2023-10-10T06:28:51.024325+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
2023-10-10T06:28:51.024326+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:25:in `each'
2023-10-10T06:28:51.024326+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/helpers.rb:25:in `ls'
2023-10-10T06:28:51.024327+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:170:in `actual_eager_load_dir'
2023-10-10T06:28:51.024327+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
2023-10-10T06:28:51.024328+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:16:in `each'
2023-10-10T06:28:51.024328+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
2023-10-10T06:28:51.024329+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
2023-10-10T06:28:51.024330+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
2023-10-10T06:28:51.024331+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:379:in `block in eager_load_all'
2023-10-10T06:28:51.024334+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:377:in `each'
2023-10-10T06:28:51.024334+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:377:in `eager_load_all'
2023-10-10T06:28:51.024335+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
2023-10-10T06:28:51.024335+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `instance_exec'
2023-10-10T06:28:51.024336+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `run'
2023-10-10T06:28:51.024336+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:61:in `block in run_initializers'
2023-10-10T06:28:51.024337+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
2023-10-10T06:28:51.024338+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2023-10-10T06:28:51.024339+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
2023-10-10T06:28:51.024339+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
2023-10-10T06:28:51.024341+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each'
2023-10-10T06:28:51.024341+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `call'
2023-10-10T06:28:51.024342+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
2023-10-10T06:28:51.024343+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
2023-10-10T06:28:51.024354+00:00 app[web.1]: from /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
2023-10-10T06:28:51.024355+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:60:in `run_initializers'
2023-10-10T06:28:51.024355+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/application.rb:372:in `initialize!'
2023-10-10T06:28:51.024355+00:00 app[web.1]: from /app/config/environment.rb:5:in `<main>'
2023-10-10T06:28:51.024355+00:00 app[web.1]: from config.ru:3:in `require_relative'
2023-10-10T06:28:51.024355+00:00 app[web.1]: from config.ru:3:in `block in <main>'
2023-10-10T06:28:51.024356+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/builder.rb:116:in `eval'
2023-10-10T06:28:51.024356+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/builder.rb:116:in `new_from_string'
2023-10-10T06:28:51.024356+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/builder.rb:105:in `load_file'
2023-10-10T06:28:51.024357+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/builder.rb:66:in `parse_file'
2023-10-10T06:28:51.024358+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/server.rb:349:in `build_app_and_options_from_config'
2023-10-10T06:28:51.024358+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/server.rb:249:in `app'
2023-10-10T06:28:51.024358+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/server.rb:422:in `wrapped_app'
2023-10-10T06:28:51.024359+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/server.rb:312:in `block in start'
2023-10-10T06:28:51.024360+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/server.rb:379:in `handle_profiling'
2023-10-10T06:28:51.024361+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/server.rb:311:in `start'
2023-10-10T06:28:51.024368+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/server/server_command.rb:38:in `start'
2023-10-10T06:28:51.024368+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/server/server_command.rb:143:in `block in perform'
2023-10-10T06:28:51.024369+00:00 app[web.1]: from <internal:kernel>:90:in `tap'
2023-10-10T06:28:51.024369+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands/server/server_command.rb:134:in `perform'
2023-10-10T06:28:51.024369+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
2023-10-10T06:28:51.024369+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
2023-10-10T06:28:51.024369+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
2023-10-10T06:28:51.024369+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command/base.rb:87:in `perform'
2023-10-10T06:28:51.024370+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/command.rb:48:in `invoke'
2023-10-10T06:28:51.024370+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
2023-10-10T06:28:51.024371+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-10-10T06:28:51.024375+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-10-10T06:28:51.024376+00:00 app[web.1]: from bin/rails:4:in `<main>'
2023-10-10T06:28:51.145517+00:00 heroku[web.1]: Process exited with status 1
2023-10-10T06:28:51.173526+00:00 heroku[web.1]: State changed from starting to crashed
2023-10-10T06:29:06.746092+00:00 app[api]: Starting process with command `rails db:migrate` by user flare.marionette@gmail.com
2023-10-10T06:29:12.087990+00:00 heroku[run.7800]: State changed from starting to up
2023-10-10T06:29:17.452987+00:00 heroku[run.7800]: Process exited with status 1
2023-10-10T06:29:17.475577+00:00 heroku[run.7800]: State changed from up to complete
2023-10-10T06:33:24.120632+00:00 app[api]: Starting process with command `gem install bundler` by user flare.marionette@gmail.com
2023-10-10T06:33:29.052685+00:00 heroku[run.2271]: State changed from starting to up
2023-10-10T06:33:41.874057+00:00 heroku[run.2271]: Process exited with status 0
2023-10-10T06:33:41.901338+00:00 heroku[run.2271]: State changed from up to complete
2023-10-10T06:33:54.022843+00:00 app[api]: Starting process with command `bundle install` by user flare.marionette@gmail.com
2023-10-10T06:34:00.512645+00:00 heroku[run.2060]: State changed from starting to up
2023-10-10T06:34:03.834081+00:00 heroku[run.2060]: Process exited with status 0
2023-10-10T06:34:03.855775+00:00 heroku[run.2060]: State changed from up to complete
2023-10-10T06:34:15.179098+00:00 app[api]: Starting process with command `rails db:migrate` by user flare.marionette@gmail.com
2023-10-10T06:34:20.374833+00:00 heroku[run.6857]: State changed from starting to up
2023-10-10T06:34:25.636814+00:00 heroku[run.6857]: Process exited with status 1
2023-10-10T06:34:26.683885+00:00 heroku[run.6857]: State changed from up to complete
2023-10-10T06:36:39.672766+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=cryptic-dawn-77749-42ec8ba960ff.herokuapp.com request_id=a0f7c1f2-b11e-4045-8c9f-278f4aa6a06c fwd="133.201.8.65" dyno= connect= service= status=503 bytes= protocol=https
2023-10-10T06:36:40.393259+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=cryptic-dawn-77749-42ec8ba960ff.herokuapp.com request_id=a2b85388-5ab6-4679-ac2c-3d552a062811 fwd="133.201.8.65" dyno= connect= service= status=503 bytes= protocol=https
$ bundle exec rails db:migrate RAILS_ENV=production
============= WARNING FROM mysql2 =============
The options :user, :pass, :hostname, :dbname, :db, and :sock are deprecated and will be removed at some point in the future.
Instead, please use :username, :password, :host, :port, :database, :socket, :flags for the options.
============= END WARNING FROM mysql2 =========
rails aborted!
ActiveRecord::DatabaseConnectionError: There is an issue connecting to your database with your username/password, username: .

Please check your database configuration to ensure the username/password are valid.

Caused by:
Mysql2::Error::ConnectionError: Access denied for user 'root'@'localhost' (using password: NO)

Tasks: TOP => db:migrate
(See full trace by running task with --trace)
kenchasonakai commented 1 year ago

このエラーに関してなにか調べたことや対応したことなどを共有お願いします

CarbazochromeT commented 1 year ago

すみません、ソースが抜けておりました。 あれから試行錯誤し、app/app/fieldに入っていたgem関連のファイルを/libディレクトリに入れたらデプロイは完了いたしました。 しかし、マイグレーションができない状況なのと、MySQLがエラーを起こしてしまっている状況です。

ActiveRecord::StatementInvalid: Mysql2::Error: Table 'qw7n2t3o8f78mknx.your_table_name' doesn't exist というエラーについて

https://qiita.com/ashketcham/items/a0d0a2ac788779895fb4 ファイルがマイグレーションできていないようだったので、 この記事を参考に、bundle exec rails db:migrate RAILS_ENV=productionというコードを打ちました。

$ bundle exec rails db:migrate RAILS_ENV=production
============= WARNING FROM mysql2 =============
The options :user, :pass, :hostname, :dbname, :db, and :sock are deprecated and will be removed at some point in the future.
Instead, please use :username, :password, :host, :port, :database, :socket, :flags for the options.
============= END WARNING FROM mysql2 =========
rails aborted!
ActiveRecord::DatabaseConnectionError: There is an issue connecting to your database with your username/password, username: .

Please check your database configuration to ensure the username/password are valid.

今現在のdatabase.ymlは

default: &default
  adapter: mysql2
  encoding: utf8mb4
  pool: 5

development:
  adapter: mysql2
  encoding: utf8
  pool: 5
  database: drug_app5_development
  username: root
  password: 42564256
  host: localhost
  socket: /tmp/mysql.sock

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *default
  database: drug_app5_test

# As with config/credentials.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password or a full connection URL as an environment
# variable when you boot the app. For example:
#
#   DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
#
# If the connection URL is provided in the special DATABASE_URL environment
# variable, Rails will automatically merge its configuration values on top of
# the values provided in this file. Alternatively, you can specify a connection
# URL environment variable explicitly:
#
#   production:
#     url: <%= ENV["MY_APP_DATABASE_URL"] %>
#
# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full overview on how database connection configuration can be specified.
#

production:
  <<: *default
  hostname: <%= ENV['DB_HOSTNAME'] %>
  username: <%= ENV['DB_USERNAME'] %>
  database: <%= ENV['DB_NAME'] %>
  password: <%= ENV['DB_PASSWORD'] %>
  url: <%= ENV['DATABASE_URL'] %>

herokuでのUsernameとPasswordはJawsDBの設定を入力しています。 エラーメッセージMysql2::Error: Table 'qw7n2t3o8f78mknx.your_table_name' doesn't existで言われる qw7n2t3o8f78mknxは、データベース名のことです。

$ heroku config                         
=== cryptic-dawn-77749 Config Vars

DATABASE_URL:             mysql2://ttbj0x1rhci4syen:qsitgephovj3wz6g@j8oay8teq9xaycnm.cbetxkdyhwsb.us-east-1.rds.amazonaws.com:3306/qw7n2t3o8f78mknx
DB_HOSTNAME:              j8oay8teq9xaycnm.cbetxkdyhwsb.us-east-1.rds.amazonaws.com
DB_NAME:                  qw7n2t3o8f78mknx
DB_PASSWORD:              qsitgephovj3wz6g
DB_USERNAME:              ttbj0x1rhci4syen
JAWSDB_ROSE_URL:          mysql://o28wpnz5qly9ms0s:xrlt01kbz0qrufzf@d6rii63wp64rsfb5.cbetxkdyhwsb.us-east-1.rds.amazonaws.com:3306/u8f1rcvbezfahq4z
JAWSDB_URL:               mysql://ttbj0x1rhci4syen:qsitgephovj3wz6g@j8oay8teq9xaycnm.cbetxkdyhwsb.us-east-1.rds.amazonaws.com:3306/qw7n2t3o8f78mknx
LANG:                     en_US.UTF-8
RACK_ENV:                 production
RAILS_ENV:                production
RAILS_LOG_TO_STDOUT:      enabled
RAILS_SERVE_STATIC_FILES: enabled
SECRET_KEY_BASE:          584d14cb745bb14cb4a181e278a990325bbc5c1402413370f68298b7b9ae4e0c318cfac2b724b6d6cbfe9804b61144420b99ae9d17dda2d45dac0d17dc75ce1d

JawsDBでの設定画面では、このように表示されておりますので、入力いたしました。(プライバシーに問題がありそうでしたらのちに消去させていただきます)

Connection Info
Connection String

mysql://ttbj0x1rhci4syen:qsitgephovj3wz6g@j8oay8teq9xaycnm.cbetxkdyhwsb.us-east-1.rds.amazonaws.com:3306/qw7n2t3o8f78mknx

You can use your connection information to connect manually through a client such as [HeidiSQL](https://www.heidisql.com/download.php) to administer your database.

Property    Value   Action
Host    j8oay8teq9xaycnm.cbetxkdyhwsb.us-east-1.rds.amazonaws.com   
Username    ttbj0x1rhci4syen    
Password    qsitgephovj3wz6g    
Port    3306    
Database    qw7n2t3o8f78mknx

また、そのあとこちらに沿ってmysqlのrootの設定の変更を行いました。 https://qiita.com/naota7118/items/b62d71484e21d6739d68

Image from Gyazo

データベースはこちらの写真にある通り、作ってあります。 また、mysql内でMySQLと同じユーザー名とパスワードのアカウントも作成いたしました。 Image from Gyazo

一度MySQLを削除し、再インストールし、MySQLの再起動を試みたところ、The server quit without updating PID file (/opt/homebrew/var/mysql/flarenoMacbook-Air.local.pid). というエラーが発生してしまい、MySQLの起動ができなくなってしまいました。 こちらはPIDフォルダが入っているところのエラーメッセージです。 下のコマンドで見れました。

# anago @ flarenoMacbook-Air in /opt/homebrew/var/mysql on git:stable o [18:29:16] C:1
$ sudo less flarenoMacbook-Air.local.err      
2023-10-11T09:20:45.781682Z 0 [Warning] [MY-010015] [Repl] Gtid table is not 
ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-10-11T09:20:45.783750Z 0 [Warning] [MY-010068] [Server] CA certificate c
a.pem is self signed.
2023-10-11T09:20:45.783765Z 0 [System] [MY-013602] [Server] Channel mysql_mai
2023-10-11T09:20:45.765030Z 0 [Warning] [MY-010441] [Server] Failed to open o
ptimizer cost constant tables
2023-10-11T09:20:45.774079Z 0 [Warning] [MY-010015] [Repl] Gtid table is not 
ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-10-11T09:20:45.781682Z 0 [Warning] [MY-010015] [Repl] Gtid table is not 
ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-10-11T09:20:45.783750Z 0 [Warning] [MY-010068] [Server] CA certificate c
a.pem is self signed.
2023-10-11T09:20:45.783765Z 0 [System] [MY-013602] [Server] Channel mysql_mai
2023-10-11T09:20:45.783750Z 0 [Warning] [MY-010068] [Server] CA certificate c
a.pem is self signed.
2023-10-11T09:20:45.783765Z 0 [System] [MY-013602] [Server] Channel mysql_mai
n configured to support TLS. Encrypted connections are now supported for this
 channel.
2023-10-11T09:20:45.784648Z 0 [Warning] [MY-010441] [Server] Failed to open o
ptimizer cost constant tables
2023-10-11T09:20:45.784713Z 0 [ERROR] [MY-013129] [Server] A message intended
 for a client cannot be sent there as no client-session is attached. Therefor
e, we're sending the information to the error-log instead: MY-001146 - Table 
'mysql.component' doesn't exist
2023-10-11T09:20:45.784724Z 0 [Warning] [MY-013129] [Server] A message intend
ed for a client cannot be sent there as no client-session is attached. Theref
ore, we're sending the information to the error-log instead: MY-003543 - The 
mysql.component table is missing or has an incorrect definition.
2023-10-11T09:20:45.784853Z 0 [ERROR] [MY-000067] [Server] unknown variable '
validate-password=OFF'.
2023-10-11T09:20:45.784939Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-10-11T09:20:46.809121Z 0 [System] [MY-010910] [Server] /opt/homebrew/opt
/mysql/bin/mysqld: Shutdown complete (mysqld 8.1.0)  Homebrew.
2023-10-11T09:20:46.809782Z 0 [System] [MY-015016] [Server] MySQL Server - en
d.
2023-10-11T09:20:46.6NZ mysqld_safe mysqld from pid file /opt/homebrew/var/my
sql/flarenoMacbook-Air.local.pid ended

ちなみに、MySQLの起動に関してはこれらのコマンドを使用しております。

$ mysql.server start
Starting MySQL
./opt/homebrew/Cellar/mysql/8.1.0/bin/mysqld_safe: line 144: /opt/homebrew/var/mysql/flarenoMacbook-Air.local.err: Permission denied
/opt/homebrew/Cellar/mysql/8.1.0/bin/mysqld_safe: line 144: /opt/homebrew/var/mysql/flarenoMacbook-Air.local.err: Permission denied
/opt/homebrew/Cellar/mysql/8.1.0/bin/mysqld_safe: line 199: /opt/homebrew/var/mysql/flarenoMacbook-Air.local.err: Permission denied
/opt/homebrew/Cellar/mysql/8.1.0/bin/mysqld_safe: line 144: /opt/homebrew/var/mysql/flarenoMacbook-Air.local.err: Permission denied
 ERROR! The server quit without updating PID file (/opt/homebrew/var/mysql/flarenoMacbook-Air.local.pid).

# anago @ flarenoMacbook-Air in /opt/homebrew/var/mysql on git:stable o [18:44:46] C:1
$ sudo chown -R anago /opt/homebrew/var/mysql/                           

# anago @ flarenoMacbook-Air in /opt/homebrew/var/mysql on git:stable o [18:45:21] 
$ mysql.server start                          
Starting MySQL
. ERROR! The server quit without updating PID file (/opt/homebrew/var/mysql/flarenoMacbook-Air.local.pid).

# anago @ flarenoMacbook-Air in /opt/homebrew/var/mysql on git:stable o [18:45:24] C:1
$ touch /opt/homebrew/var/mysql/flarenoMacbook-Air.local.pid

# anago @ flarenoMacbook-Air in /opt/homebrew/var/mysql on git:stable o [18:45:35] 
$ mysql.server start                                        
Starting MySQL
. ERROR! The server quit without updating PID file (/opt/homebrew/var/mysql/flarenoMacbook-Air.local.pid).

# anago @ flarenoMacbook-Air in /opt/homebrew/var/mysql on git:stable o [18:45:38] C:1
$ brew doctor                                               
Your system is ready to brew.

$ mysql -u root                                      
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

# anago @ flarenoMacbook-Air in /opt/homebrew/var/mysql on git:stable o [18:48:02] C:1
$ touch ~/tmp/mysql.sock                                    
touch: /Users/flare_home/tmp/mysql.sock: No such file or directory

# anago @ flarenoMacbook-Air in /opt/homebrew/var/mysql on git:stable o [18:48:11] C:1
$ touch /tmp/mysql.sock 

# anago @ flarenoMacbook-Air in /opt/homebrew/var/mysql on git:stable o [18:48:25] 
$ mysql -u root         
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
kenchasonakai commented 1 year ago

今は本番環境でエラーが起きているということだと思います。

bundle exec rails db:migrate RAILS_ENV=production や mysql.server start は開発環境で行うコマンドだと思いますがその辺り理解して実行していますかね? 再度Herokuのデータベースを操作するコマンドを調べてみるといいかもしれません

CarbazochromeT commented 1 year ago

そうだったのですね。 mysql自体のエラーを解消しようとして使用していました。 もう一度見直してみます。

bundle exec rails db:migrate RAILS_ENV=production このコマンドは、こちらの記事を参考にいたしました。

https://qiita.com/ken_sasaki2/items/263354e0c784e7710ca8

$ heroku run rails db:migrate             
Running rails db:migrate on ⬢ care-drug-searcher... up, run.4343 (Basic)
============= WARNING FROM mysql2 =============
The options :user, :pass, :hostname, :dbname, :db, and :sock are deprecated and will be removed at some point in the future.
Instead, please use :username, :password, :host, :port, :database, :socket, :flags for the options.
============= END WARNING FROM mysql2 =========
============= WARNING FROM mysql2 =============
The options :user, :pass, :hostname, :dbname, :db, and :sock are deprecated and will be removed at some point in the future.
Instead, please use :username, :password, :host, :port, :database, :socket, :flags for the options.
============= END WARNING FROM mysql2 =========
I, [2023-10-11T21:36:03.035896 #2]  INFO -- : Migrating to ChangePrimaryKey (20230909001430)
== 20230909001430 ChangePrimaryKey: migrating =================================
-- execute("ALTER TABLE your_table_name DROP PRIMARY KEY, ADD PRIMARY KEY (new_primary_key_column);")
rails aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Table 'qw7n2t3o8f78mknx.your_table_name' doesn't exist
/app/vendor/bundle/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:151:in `_query'

マイグレーションしようとすると毎回このエラーが起きるため、MySQL自体の設定を見直そうとしておりますが、MySQL自体が今は立ち上がらない状態です

$ mysql -u root                       
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)

# anago @ flarenoMacbook-Air in /opt/homebrew/var/mysql on git:stable o [6:37:10] C:1
$ mysql -u root -p           
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)

# anago @ flarenoMacbook-Air in /opt/homebrew/var/mysql on git:stable o [6:40:28] C:1
$ mysql.server start         
Starting MySQL
. ERROR! The server quit without updating PID file (/opt/homebrew/var/mysql/flarenoMacbook-Air.local.pid).

今後、MySQLのdevelopで使用したデータベースの中身をproductionの方にも移す予定なので、developmentのほうのMySQLに接続できないと厳しい状況です。

kenchasonakai commented 1 year ago

本番環境へのpush・Zeitwerk・本番環境のMySQL・開発環境のMySQLなどさまざまな要素が入ってしまっているので、まずご自身で適切に問題を切り分けて一つずつ質問していただけると回答しやすいです。

開発環境のMySQLが起動しないことを解決したいのであればこちらのissueは一度closeして新たにissueを立てて情報を整理して共有していただけますか?

CarbazochromeT commented 1 year ago

かしこまりました。別途複数のissueに分けさせていただきます。 情報がごちゃごちゃしてしまいまして申し訳ありません。