问:
I'm unsure on what the issue is when deploying my ruby on rails application to heroku
I have built a ruby on rails application that works perfectly on my local dev environment. I'm trying to deploy it to heroku. My CI/CD pipline informs me that everything has run and has built. However when I try to access the page I get the following error.

The logs don't make much sense to me, so would someone be able to help me?

```2022-12-07T18:20:21.329065+00:00 app[web.1]: from config.ru:5:in `require_relative'
2022-12-07T18:20:21.329077+00:00 app[web.1]: from config.ru:5:in `block in '
2022-12-07T18:20:21.329090+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `eval'
2022-12-07T18:20:21.329103+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `new_from_string'
2022-12-07T18:20:21.329116+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:105:in `load_file'
2022-12-07T18:20:21.329129+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:66:in `parse_file'
2022-12-07T18:20:21.329142+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
2022-12-07T18:20:21.329155+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:249:in `app'
2022-12-07T18:20:21.329168+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:422:in `wrapped_app'
2022-12-07T18:20:21.329181+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:312:in `block in start'
2022-12-07T18:20:21.329194+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:379:in `handle_profiling'
2022-12-07T18:20:21.329207+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:311:in `start'
2022-12-07T18:20:21.329220+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:38:in `start'
2022-12-07T18:20:21.329232+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:143:in `block in perform'
2022-12-07T18:20:21.329245+00:00 app[web.1]: from <internal:kernel>:90:in `tap'
2022-12-07T18:20:21.329258+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:134:in `perform'
2022-12-07T18:20:21.329271+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
2022-12-07T18:20:21.329284+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
2022-12-07T18:20:21.329297+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
2022-12-07T18:20:21.329310+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:in `perform'
2022-12-07T18:20:21.329323+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/command.rb:48:in `invoke'
2022-12-07T18:20:21.329336+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `'
2022-12-07T18:20:21.329348+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-07T18:20:21.329361+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-07T18:20:21.329374+00:00 app[web.1]: from bin/rails:6:in `'
2022-12-07T18:20:21.513425+00:00 heroku[web.1]: Process exited with status 1
2022-12-07T18:20:21.569546+00:00 heroku[web.1]: State changed from starting to crashed
2022-12-07T18:20:21.572883+00:00 heroku[web.1]: State changed from crashed to starting
2022-12-07T18:20:27.250273+00:00 heroku[web.1]: Starting process with command `bin/rails server -p ${PORT:-5000} -e production`
2022-12-07T18:20:31.591717+00:00 app[web.1]: => Booting Puma
2022-12-07T18:20:31.591745+00:00 app[web.1]: => Rails 7.0.4 application starting in production
2022-12-07T18:20:31.591746+00:00 app[web.1]: => Run `bin/rails server --help` for more startup options
2022-12-07T18:20:32.603915+00:00 app[web.1]: Exiting
2022-12-07T18:20:32.604685+00:00 app[web.1]: /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/callbacks.rb:25:in `on_file_autoloaded': expected file /app/app/jobs/example_job.rb to define constant ExampleJob, but didn't (Zeitwerk::NameError)
2022-12-07T18:20:32.604697+00:00 app[web.1]:
2022-12-07T18:20:32.604699+00:00 app[web.1]: raise Zeitwerk::NameError.new("expected file #{file} to define constant #{cpath}, but didn't", cref.last)
2022-12-07T18:20:32.604711+00:00 app[web.1]: ^^^^^
2022-12-07T18:20:32.604728+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:31:in `require'
2022-12-07T18:20:32.604742+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
2022-12-07T18:20:32.604756+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:135:in `cget'
2022-12-07T18:20:32.604771+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:169:in `block in actual_eager_load_dir'
2022-12-07T18:20:32.604785+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
2022-12-07T18:20:32.604799+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:25:in `each'
2022-12-07T18:20:32.604813+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:25:in `ls'
2022-12-07T18:20:32.604828+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:164:in `actual_eager_load_dir'
2022-12-07T18:20:32.604842+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
2022-12-07T18:20:32.604855+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:16:in `each'
2022-12-07T18:20:32.604869+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
2022-12-07T18:20:32.604884+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
2022-12-07T18:20:32.604898+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
2022-12-07T18:20:32.604912+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:296:in `block in eager_load_all'
2022-12-07T18:20:32.604925+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:294:in `each'
2022-12-07T18:20:32.604939+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:294:in `eager_load_all'
2022-12-07T18:20:32.604953+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
2022-12-07T18:20:32.604967+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `instance_exec'
2022-12-07T18:20:32.604980+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `run'
2022-12-07T18:20:32.604994+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:61:in `block in run_initializers'
2022-12-07T18:20:32.605007+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
2022-12-07T18:20:32.605021+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2022-12-07T18:20:32.605035+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
2022-12-07T18:20:32.605049+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
2022-12-07T18:20:32.605064+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each'
2022-12-07T18:20:32.605077+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `call'
2022-12-07T18:20:32.605091+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
2022-12-07T18:20:32.605105+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
2022-12-07T18:20:32.605118+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
2022-12-07T18:20:32.605132+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:60:in `run_initializers'
2022-12-07T18:20:32.605147+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/application.rb:372:in `initialize!'
2022-12-07T18:20:32.605162+00:00 app[web.1]: from /app/config/environment.rb:7:in `'
2022-12-07T18:20:32.605176+00:00 app[web.1]: from config.ru:5:in `require_relative'
2022-12-07T18:20:32.605190+00:00 app[web.1]: from config.ru:5:in `block in '
2022-12-07T18:20:32.605203+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `eval'
2022-12-07T18:20:32.605217+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `new_from_string'
2022-12-07T18:20:32.605230+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:105:in `load_file'
2022-12-07T18:20:32.605244+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:66:in `parse_file'
2022-12-07T18:20:32.605258+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
2022-12-07T18:20:32.605271+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:249:in `app'
2022-12-07T18:20:32.605286+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:422:in `wrapped_app'
2022-12-07T18:20:32.605299+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:312:in `block in start'
2022-12-07T18:20:32.605313+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:379:in `handle_profiling'
2022-12-07T18:20:32.605327+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:311:in `start'
2022-12-07T18:20:32.605341+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:38:in `start'
2022-12-07T18:20:32.605358+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:143:in `block in perform'
2022-12-07T18:20:32.605372+00:00 app[web.1]: from <internal:kernel>:90:in `tap'
2022-12-07T18:20:32.605387+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:134:in `perform'
2022-12-07T18:20:32.605400+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
2022-12-07T18:20:32.605415+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
2022-12-07T18:20:32.605429+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
2022-12-07T18:20:32.605443+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:in `perform'
2022-12-07T18:20:32.605458+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/command.rb:48:in `invoke'
2022-12-07T18:20:32.605472+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `'
2022-12-07T18:20:32.605486+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-07T18:20:32.605501+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-07T18:20:32.605527+00:00 app[web.1]: from bin/rails:6:in `'
2022-12-07T18:20:32.789481+00:00 heroku[web.1]: Process exited with status 1
2022-12-07T18:20:32.849001+00:00 heroku[web.1]: State changed from starting to crashed
2022-12-07T18:20:35.959337+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=book-review-app-1.herokuapp.com request_id=efb13321-b44e-4094-b31b-7e8f7937843f fwd="78.18.88.26" dyno= connect= service= status=503 bytes= protocol=https
2022-12-07T18:20:36.369851+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=book-review-app-1.herokuapp.com request_id=fdac1969-bc20-4ee8-9cbd-fb2dc49d061b fwd="78.18.88.26" dyno= connect= service= status=503 bytes= protocol=https
2022-12-07T18:34:32.202811+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=book-review-app-1.herokuapp.com request_id=dc080b47-b4c6-4f18-bbe7-a52918a2276b fwd="78.18.88.26" dyno= connect= service= status=503 bytes= protocol=https
2022-12-07T18:34:32.485141+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=book-review-app-1.herokuapp.com request_id=a95c315e-b461-48e0-ba1f-5dff9b728c74 fwd="78.18.88.26" dyno= connect= service= status=503 bytes= protocol=https
2022-12-07T18:42:42.437384+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=book-review-app-1.herokuapp.com request_id=9a477568-33a4-48c2-92dd-9fd2ff27c72d fwd="78.18.88.26" dyno= connect= service= status=503 bytes= protocol=https
2022-12-07T18:42:42.113747+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=book-review-app-1.herokuapp.com request_id=91c95dc3-8614-4c34-906b-aa4715eca822 fwd="78.18.88.26" dyno= connect= service= status=503 bytes= protocol=https
2022-12-07T18:42:52.090683+00:00 heroku[web.1]: State changed from crashed to starting
2022-12-07T18:42:57.205143+00:00 heroku[web.1]: Starting process with command `bin/rails server -p ${PORT:-5000} -e production`
2022-12-07T18:43:00.924373+00:00 heroku[web.1]: Process exited with status 1
2022-12-07T18:43:00.971586+00:00 heroku[web.1]: State changed from starting to crashed
2022-12-07T18:43:00.041890+00:00 app[web.1]: => Booting Puma
2022-12-07T18:43:00.041928+00:00 app[web.1]: => Rails 7.0.4 application starting in production
2022-12-07T18:43:00.041928+00:00 app[web.1]: => Run `bin/rails server --help` for more startup options
2022-12-07T18:43:00.787451+00:00 app[web.1]: Exiting
2022-12-07T18:43:00.787935+00:00 app[web.1]: /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/callbacks.rb:25:in `on_file_autoloaded': expected file /app/app/jobs/example_job.rb to define constant ExampleJob, but didn't (Zeitwerk::NameError)
2022-12-07T18:43:00.787937+00:00 app[web.1]:
2022-12-07T18:43:00.787939+00:00 app[web.1]: raise Zeitwerk::NameError.new("expected file #{file} to define constant #{cpath}, but didn't", cref.last)
2022-12-07T18:43:00.787941+00:00 app[web.1]: ^^^^^
2022-12-07T18:43:00.787949+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:31:in `require'
2022-12-07T18:43:00.787951+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
2022-12-07T18:43:00.787953+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:135:in `cget'
2022-12-07T18:43:00.787962+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:169:in `block in actual_eager_load_dir'
2022-12-07T18:43:00.787964+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
2022-12-07T18:43:00.787966+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:25:in `each'
2022-12-07T18:43:00.787968+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:25:in `ls'
2022-12-07T18:43:00.787977+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:164:in `actual_eager_load_dir'
2022-12-07T18:43:00.787979+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
2022-12-07T18:43:00.787981+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:16:in `each'
2022-12-07T18:43:00.787983+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
2022-12-07T18:43:00.787992+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
2022-12-07T18:43:00.787994+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
2022-12-07T18:43:00.787995+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:296:in `block in eager_load_all'
2022-12-07T18:43:00.788003+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:294:in `each'
2022-12-07T18:43:00.788006+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:294:in `eager_load_all'
2022-12-07T18:43:00.788007+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
2022-12-07T18:43:00.788010+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `instance_exec'
2022-12-07T18:43:00.788017+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `run'
2022-12-07T18:43:00.788020+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:61:in `block in run_initializers'
2022-12-07T18:43:00.788038+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
2022-12-07T18:43:00.788041+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2022-12-07T18:43:00.788041+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
2022-12-07T18:43:00.788041+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
2022-12-07T18:43:00.788041+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each'
2022-12-07T18:43:00.788042+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `call'
2022-12-07T18:43:00.788042+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
2022-12-07T18:43:00.788042+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
2022-12-07T18:43:00.788044+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
2022-12-07T18:43:00.788051+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:60:in `run_initializers'
2022-12-07T18:43:00.788053+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/application.rb:372:in `initialize!'
2022-12-07T18:43:00.788061+00:00 app[web.1]: from /app/config/environment.rb:7:in `'
2022-12-07T18:43:00.788062+00:00 app[web.1]: from config.ru:5:in `require_relative'
2022-12-07T18:43:00.788064+00:00 app[web.1]: from config.ru:5:in `block in '
2022-12-07T18:43:00.788072+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `eval'
2022-12-07T18:43:00.788074+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `new_from_string'
2022-12-07T18:43:00.788082+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:105:in `load_file'
2022-12-07T18:43:00.788083+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:66:in `parse_file'
2022-12-07T18:43:00.788091+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
2022-12-07T18:43:00.788093+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:249:in `app'
2022-12-07T18:43:00.788095+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:422:in `wrapped_app'
2022-12-07T18:43:00.788104+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:312:in `block in start'
2022-12-07T18:43:00.788106+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:379:in `handle_profiling'
2022-12-07T18:43:00.788108+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:311:in `start'
2022-12-07T18:43:00.788110+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:38:in `start'
2022-12-07T18:43:00.788113+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:143:in `block in perform'
2022-12-07T18:43:00.788121+00:00 app[web.1]: from <internal:kernel>:90:in `tap'
2022-12-07T18:43:00.788124+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:134:in `perform'
2022-12-07T18:43:00.788126+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
2022-12-07T18:43:00.788128+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
2022-12-07T18:43:00.788135+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
2022-12-07T18:43:00.788137+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:in `perform'
2022-12-07T18:43:00.788144+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/command.rb:48:in `invoke'
2022-12-07T18:43:00.788146+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `'
2022-12-07T18:43:00.788153+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-07T18:43:00.788155+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-07T18:43:00.788162+00:00 app[web.1]: from bin/rails:6:in `'
```

I have tried searching for solutoins on google and following youtube videos, but I can't get this working. Any help would be greatly appreciated.

Body:
I have built a ruby on rails application that works perfectly on my local dev environment. I'm trying to deploy it to heroku. My CI/CD pipline informs me that everything has run and has built. However when I try to access the page I get the following error.

The logs don't make much sense to me, so would someone be able to help me?

2022-12-07T18:20:21.329065+00:00 app[web.1]: from config.ru:5:in `require_relative'
2022-12-07T18:20:21.329077+00:00 app[web.1]: from config.ru:5:in `block in '
2022-12-07T18:20:21.329090+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `eval'
2022-12-07T18:20:21.329103+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `new_from_string'
2022-12-07T18:20:21.329116+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:105:in `load_file'
2022-12-07T18:20:21.329129+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:66:in `parse_file'
2022-12-07T18:20:21.329142+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
2022-12-07T18:20:21.329155+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:249:in `app'
2022-12-07T18:20:21.329168+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:422:in `wrapped_app'
2022-12-07T18:20:21.329181+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:312:in `block in start'
2022-12-07T18:20:21.329194+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:379:in `handle_profiling'
2022-12-07T18:20:21.329207+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:311:in `start'
2022-12-07T18:20:21.329220+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:38:in `start'
2022-12-07T18:20:21.329232+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:143:in `block in perform'
2022-12-07T18:20:21.329245+00:00 app[web.1]: from <internal:kernel>:90:in `tap'
2022-12-07T18:20:21.329258+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:134:in `perform'
2022-12-07T18:20:21.329271+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
2022-12-07T18:20:21.329284+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
2022-12-07T18:20:21.329297+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
2022-12-07T18:20:21.329310+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:in `perform'
2022-12-07T18:20:21.329323+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/command.rb:48:in `invoke'
2022-12-07T18:20:21.329336+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `'
2022-12-07T18:20:21.329348+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-07T18:20:21.329361+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-07T18:20:21.329374+00:00 app[web.1]: from bin/rails:6:in `'
2022-12-07T18:20:21.513425+00:00 heroku[web.1]: Process exited with status 1
2022-12-07T18:20:21.569546+00:00 heroku[web.1]: State changed from starting to crashed
2022-12-07T18:20:21.572883+00:00 heroku[web.1]: State changed from crashed to starting
2022-12-07T18:20:27.250273+00:00 heroku[web.1]: Starting process with command `bin/rails server -p ${PORT:-5000} -e production`
2022-12-07T18:20:31.591717+00:00 app[web.1]: => Booting Puma
2022-12-07T18:20:31.591745+00:00 app[web.1]: => Rails 7.0.4 application starting in production
2022-12-07T18:20:31.591746+00:00 app[web.1]: => Run `bin/rails server --help` for more startup options
2022-12-07T18:20:32.603915+00:00 app[web.1]: Exiting
2022-12-07T18:20:32.604685+00:00 app[web.1]: /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/callbacks.rb:25:in `on_file_autoloaded': expected file /app/app/jobs/example_job.rb to define constant ExampleJob, but didn't (Zeitwerk::NameError)
2022-12-07T18:20:32.604697+00:00 app[web.1]:
2022-12-07T18:20:32.604699+00:00 app[web.1]: raise Zeitwerk::NameError.new("expected file #{file} to define constant #{cpath}, but didn't", cref.last)
2022-12-07T18:20:32.604711+00:00 app[web.1]: ^^^^^
2022-12-07T18:20:32.604728+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:31:in `require'
2022-12-07T18:20:32.604742+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
2022-12-07T18:20:32.604756+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:135:in `cget'
2022-12-07T18:20:32.604771+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:169:in `block in actual_eager_load_dir'
2022-12-07T18:20:32.604785+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
2022-12-07T18:20:32.604799+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:25:in `each'
2022-12-07T18:20:32.604813+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:25:in `ls'
2022-12-07T18:20:32.604828+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:164:in `actual_eager_load_dir'
2022-12-07T18:20:32.604842+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
2022-12-07T18:20:32.604855+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:16:in `each'
2022-12-07T18:20:32.604869+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
2022-12-07T18:20:32.604884+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
2022-12-07T18:20:32.604898+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
2022-12-07T18:20:32.604912+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:296:in `block in eager_load_all'
2022-12-07T18:20:32.604925+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:294:in `each'
2022-12-07T18:20:32.604939+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:294:in `eager_load_all'
2022-12-07T18:20:32.604953+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
2022-12-07T18:20:32.604967+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `instance_exec'
2022-12-07T18:20:32.604980+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `run'
2022-12-07T18:20:32.604994+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:61:in `block in run_initializers'
2022-12-07T18:20:32.605007+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
2022-12-07T18:20:32.605021+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2022-12-07T18:20:32.605035+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
2022-12-07T18:20:32.605049+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
2022-12-07T18:20:32.605064+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each'
2022-12-07T18:20:32.605077+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `call'
2022-12-07T18:20:32.605091+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
2022-12-07T18:20:32.605105+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
2022-12-07T18:20:32.605118+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
2022-12-07T18:20:32.605132+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:60:in `run_initializers'
2022-12-07T18:20:32.605147+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/application.rb:372:in `initialize!'
2022-12-07T18:20:32.605162+00:00 app[web.1]: from /app/config/environment.rb:7:in `'
2022-12-07T18:20:32.605176+00:00 app[web.1]: from config.ru:5:in `require_relative'
2022-12-07T18:20:32.605190+00:00 app[web.1]: from config.ru:5:in `block in '
2022-12-07T18:20:32.605203+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `eval'
2022-12-07T18:20:32.605217+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `new_from_string'
2022-12-07T18:20:32.605230+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:105:in `load_file'
2022-12-07T18:20:32.605244+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:66:in `parse_file'
2022-12-07T18:20:32.605258+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
2022-12-07T18:20:32.605271+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:249:in `app'
2022-12-07T18:20:32.605286+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:422:in `wrapped_app'
2022-12-07T18:20:32.605299+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:312:in `block in start'
2022-12-07T18:20:32.605313+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:379:in `handle_profiling'
2022-12-07T18:20:32.605327+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:311:in `start'
2022-12-07T18:20:32.605341+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:38:in `start'
2022-12-07T18:20:32.605358+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:143:in `block in perform'
2022-12-07T18:20:32.605372+00:00 app[web.1]: from <internal:kernel>:90:in `tap'
2022-12-07T18:20:32.605387+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:134:in `perform'
2022-12-07T18:20:32.605400+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
2022-12-07T18:20:32.605415+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
2022-12-07T18:20:32.605429+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
2022-12-07T18:20:32.605443+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:in `perform'
2022-12-07T18:20:32.605458+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/command.rb:48:in `invoke'
2022-12-07T18:20:32.605472+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `'
2022-12-07T18:20:32.605486+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-07T18:20:32.605501+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-07T18:20:32.605527+00:00 app[web.1]: from bin/rails:6:in `'
2022-12-07T18:20:32.789481+00:00 heroku[web.1]: Process exited with status 1
2022-12-07T18:20:32.849001+00:00 heroku[web.1]: State changed from starting to crashed
2022-12-07T18:20:35.959337+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=book-review-app-1.herokuapp.com request_id=efb13321-b44e-4094-b31b-7e8f7937843f fwd="78.18.88.26" dyno= connect= service= status=503 bytes= protocol=https
2022-12-07T18:20:36.369851+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=book-review-app-1.herokuapp.com request_id=fdac1969-bc20-4ee8-9cbd-fb2dc49d061b fwd="78.18.88.26" dyno= connect= service= status=503 bytes= protocol=https
2022-12-07T18:34:32.202811+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=book-review-app-1.herokuapp.com request_id=dc080b47-b4c6-4f18-bbe7-a52918a2276b fwd="78.18.88.26" dyno= connect= service= status=503 bytes= protocol=https
2022-12-07T18:34:32.485141+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=book-review-app-1.herokuapp.com request_id=a95c315e-b461-48e0-ba1f-5dff9b728c74 fwd="78.18.88.26" dyno= connect= service= status=503 bytes= protocol=https
2022-12-07T18:42:42.437384+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=book-review-app-1.herokuapp.com request_id=9a477568-33a4-48c2-92dd-9fd2ff27c72d fwd="78.18.88.26" dyno= connect= service= status=503 bytes= protocol=https
2022-12-07T18:42:42.113747+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=book-review-app-1.herokuapp.com request_id=91c95dc3-8614-4c34-906b-aa4715eca822 fwd="78.18.88.26" dyno= connect= service= status=503 bytes= protocol=https
2022-12-07T18:42:52.090683+00:00 heroku[web.1]: State changed from crashed to starting
2022-12-07T18:42:57.205143+00:00 heroku[web.1]: Starting process with command `bin/rails server -p ${PORT:-5000} -e production`
2022-12-07T18:43:00.924373+00:00 heroku[web.1]: Process exited with status 1
2022-12-07T18:43:00.971586+00:00 heroku[web.1]: State changed from starting to crashed
2022-12-07T18:43:00.041890+00:00 app[web.1]: => Booting Puma
2022-12-07T18:43:00.041928+00:00 app[web.1]: => Rails 7.0.4 application starting in production
2022-12-07T18:43:00.041928+00:00 app[web.1]: => Run `bin/rails server --help` for more startup options
2022-12-07T18:43:00.787451+00:00 app[web.1]: Exiting
2022-12-07T18:43:00.787935+00:00 app[web.1]: /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/callbacks.rb:25:in `on_file_autoloaded': expected file /app/app/jobs/example_job.rb to define constant ExampleJob, but didn't (Zeitwerk::NameError)
2022-12-07T18:43:00.787937+00:00 app[web.1]:
2022-12-07T18:43:00.787939+00:00 app[web.1]: raise Zeitwerk::NameError.new("expected file #{file} to define constant #{cpath}, but didn't", cref.last)
2022-12-07T18:43:00.787941+00:00 app[web.1]: ^^^^^
2022-12-07T18:43:00.787949+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:31:in `require'
2022-12-07T18:43:00.787951+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
2022-12-07T18:43:00.787953+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:135:in `cget'
2022-12-07T18:43:00.787962+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:169:in `block in actual_eager_load_dir'
2022-12-07T18:43:00.787964+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
2022-12-07T18:43:00.787966+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:25:in `each'
2022-12-07T18:43:00.787968+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:25:in `ls'
2022-12-07T18:43:00.787977+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:164:in `actual_eager_load_dir'
2022-12-07T18:43:00.787979+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
2022-12-07T18:43:00.787981+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:16:in `each'
2022-12-07T18:43:00.787983+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
2022-12-07T18:43:00.787992+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
2022-12-07T18:43:00.787994+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
2022-12-07T18:43:00.787995+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:296:in `block in eager_load_all'
2022-12-07T18:43:00.788003+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:294:in `each'
2022-12-07T18:43:00.788006+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:294:in `eager_load_all'
2022-12-07T18:43:00.788007+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
2022-12-07T18:43:00.788010+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `instance_exec'
2022-12-07T18:43:00.788017+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `run'
2022-12-07T18:43:00.788020+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:61:in `block in run_initializers'
2022-12-07T18:43:00.788038+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
2022-12-07T18:43:00.788041+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2022-12-07T18:43:00.788041+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
2022-12-07T18:43:00.788041+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
2022-12-07T18:43:00.788041+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each'
2022-12-07T18:43:00.788042+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `call'
2022-12-07T18:43:00.788042+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
2022-12-07T18:43:00.788042+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
2022-12-07T18:43:00.788044+00:00 app[web.1]: from /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
2022-12-07T18:43:00.788051+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/initializable.rb:60:in `run_initializers'
2022-12-07T18:43:00.788053+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/application.rb:372:in `initialize!'
2022-12-07T18:43:00.788061+00:00 app[web.1]: from /app/config/environment.rb:7:in `'
2022-12-07T18:43:00.788062+00:00 app[web.1]: from config.ru:5:in `require_relative'
2022-12-07T18:43:00.788064+00:00 app[web.1]: from config.ru:5:in `block in '
2022-12-07T18:43:00.788072+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `eval'
2022-12-07T18:43:00.788074+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `new_from_string'
2022-12-07T18:43:00.788082+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:105:in `load_file'
2022-12-07T18:43:00.788083+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:66:in `parse_file'
2022-12-07T18:43:00.788091+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
2022-12-07T18:43:00.788093+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:249:in `app'
2022-12-07T18:43:00.788095+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:422:in `wrapped_app'
2022-12-07T18:43:00.788104+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:312:in `block in start'
2022-12-07T18:43:00.788106+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:379:in `handle_profiling'
2022-12-07T18:43:00.788108+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:311:in `start'
2022-12-07T18:43:00.788110+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:38:in `start'
2022-12-07T18:43:00.788113+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:143:in `block in perform'
2022-12-07T18:43:00.788121+00:00 app[web.1]: from <internal:kernel>:90:in `tap'
2022-12-07T18:43:00.788124+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:134:in `perform'
2022-12-07T18:43:00.788126+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
2022-12-07T18:43:00.788128+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
2022-12-07T18:43:00.788135+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
2022-12-07T18:43:00.788137+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:in `perform'
2022-12-07T18:43:00.788144+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/command.rb:48:in `invoke'
2022-12-07T18:43:00.788146+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `'
2022-12-07T18:43:00.788153+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-07T18:43:00.788155+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-07T18:43:00.788162+00:00 app[web.1]: from bin/rails:6:in `'

I have tried searching for solutoins on google and following youtube videos, but I can't get this working. Any help would be greatly appreciated.


来源: stackexchange

问:
Log Noise WatchOS "nw_protocol_get_quic_image_block_invoke dlopen libquic failed"
I creating a simple websocket session. It append only during the first call of the function initConnection. Everything work fine but I am affraid to have issues on real device despite what I have read. It seems to come from websocket.resume().

My code ->

```<code>func initConnection()
    {
        if let url = URL(string: "wss://irc-ws.chat.twitch.tv:443")
        {
            let urlSession = URLSession(configuration: .default)
            webSocketTask = urlSession.webSocketTask(with: url)
        }
        guard let websocket = webSocketTask else {
            print(" Error Init : WebSocket init Failed")
            onError()
            return
        }

        websocket.resume()
        currentChannels = []
        receiveMessage()
        sendMessage("CAP REQ : twitch.tv/tags")
        sendMessage("PASS " + botProfil.account)
        sendMessage("NICK " + botProfil.username)
    }
</code>```

The log ->

```<code>2022-12-07 19:25:15.056322+0100 WatchOS-Twitch-Chat Watch App[8082:121266] []
nw_protocol_get_quic_image_block_invoke dlopen libquic failed: dlopen(/usr/lib/libquic.dylib,
 0x0005): tried:
'/Users/quentinjeanningros/Library/Developer/Xcode/DerivedData/WatchOS-Twitch-Chat-cvwsrdgjhxgwscbhytrlcgcgrbjx/Build/Products/Debug-watchsimulator/libquic.dylib' (errno=2),
'/Users/quentinjeanningros/Library/Developer/Xcode/DerivedData/WatchOS-Twitch-Chat-cvwsrdgjhxgwscbhytrlcgcgrbjx/Build/Products/Debug-watchsimulator/libquic.dylib' (errno=2),
'/Library/Developer/CoreSimulator/Volumes/watchOS_20S75/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 9.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libquic.dylib' (errno=2),
'/Library/Developer/CoreSimulator/Volumes/watchOS_20S75/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 9.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libquic.dylib' (errno=2),
'/usr/lib/libquic.dylib' (errno=2, not in dyld cache)
</code>```

How clean can I clean my code to remove this logs ?

ContentLicense: CC BY-SA 4.0

Body:
I creating a simple websocket session. It append only during the first call of the function initConnection. Everything work fine but I am affraid to have issues on real device despite what I have read. It seems to come from websocket.resume().

My code ->

func initConnection()
    {
        if let url = URL(string: "wss://irc-ws.chat.twitch.tv:443")
        {
            let urlSession = URLSession(configuration: .default)
            webSocketTask = urlSession.webSocketTask(with: url)
        }
        guard let websocket = webSocketTask else {
            print(" Error Init : WebSocket init Failed")
            onError()
            return
        }

        websocket.resume()
        currentChannels = []
        receiveMessage()
        sendMessage("CAP REQ : twitch.tv/tags")
        sendMessage("PASS " + botProfil.account)
        sendMessage("NICK " + botProfil.username)
    }

The log ->

2022-12-07 19:25:15.056322+0100 WatchOS-Twitch-Chat Watch App[8082:121266] []
nw_protocol_get_quic_image_block_invoke dlopen libquic failed: dlopen(/usr/lib/libquic.dylib,
 0x0005): tried:
'/Users/quentinjeanningros/Library/Developer/Xcode/DerivedData/WatchOS-Twitch-Chat-cvwsrdgjhxgwscbhytrlcgcgrbjx/Build/Products/Debug-watchsimulator/libquic.dylib' (errno=2),
'/Users/quentinjeanningros/Library/Developer/Xcode/DerivedData/WatchOS-Twitch-Chat-cvwsrdgjhxgwscbhytrlcgcgrbjx/Build/Products/Debug-watchsimulator/libquic.dylib' (errno=2),
'/Library/Developer/CoreSimulator/Volumes/watchOS_20S75/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 9.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libquic.dylib' (errno=2),
'/Library/Developer/CoreSimulator/Volumes/watchOS_20S75/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 9.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libquic.dylib' (errno=2),
'/usr/lib/libquic.dylib' (errno=2, not in dyld cache)

How clean can I clean my code to remove this logs ?


问:
node-postgres self signed certificate in certificate chain
I have an Azure Postgres instance, and I am trying to connect to it using node-postgres (pg) module but getting Self signed certificate in certificate chain error.

I am able to connect using psql with sslmode=require param

Below is my code snippet

Since my password contains certain special characters i've used encodeURIComponent, and its managed by my org so I can't change it.

```<code>const getDBUrl = () => {
  return `postgres://${DB_USERNAME}:${encodeURIComponent(DB_PASSWORD)}@${DB_HOSTNAME}:${DB_PORT}/${DB_NAME}`;
};

const newPgPool = new Pool({
  connectionString: getDBUrl(),
  ssl: {
    rejectUnauthorized: false,
  }
});
</code>```

As far as i know, setting rejectUnauthorized: false would use SSL but won't reject self signed certs.

Node: 16.14.0
pg: 8.8.0

Body:
I have an Azure Postgres instance, and I am trying to connect to it using node-postgres (pg) module but getting Self signed certificate in certificate chain error.

I am able to connect using psql with sslmode=require param

Below is my code snippet

Since my password contains certain special characters i've used encodeURIComponent, and its managed by my org so I can't change it.

const getDBUrl = () => {
  return `postgres://${DB_USERNAME}:${encodeURIComponent(DB_PASSWORD)}@${DB_HOSTNAME}:${DB_PORT}/${DB_NAME}`;
};

const newPgPool = new Pool({
  connectionString: getDBUrl(),
  ssl: {
    rejectUnauthorized: false,
  }
});

As far as i know, setting rejectUnauthorized: false would use SSL but won't reject self signed certs.

Node: 16.14.0
pg: 8.8.0


问:
How to access an object property inside a function that's inside a class
I was trying to fetch the ID that has been created from a new class to use it as a data key, but I can't seem to be able to access it. How can be able to do so, kindly help.

My code has a class and a function that uses the class to create a new item and append it onto a main container in my html file.

I want to use the setAttribute method to add a data-key and link the ID that has been created by the function createProjectItem() in the class but it says that the new class(newProject) has not been defined.

class NewProject {
  constructor(title) {
    this.title = title;
  }

  createProjectItem() {
    const projectArray = {
      title: this.title,
      id: Date.now(),
      //ID TO BE ACCESSED ↑↑
    };
    projectArrayList.push(projectArray)
    console.log(projectArrayList);
  }
}

const createProjectList = document.querySelector(".create-projectList");

export default function createProjectFromClass() {
  createProjectList.addEventListener("click",() => {

    //Creates new class
    const Titleinput = document.getElementById("project-title");
    const titleText = Titleinput.value.trim();

    if (titleText !== "") {
      const newProject = new NewProject(titleText);
      newProject.createProjectItem()
      console.log(newProject.id);
      Titleinput.value = "";
    }

    //Append new class to projects list
    function appendProject() {
      const container = document.querySelector(".projects");
      const createProject = document.querySelector(".create-project")
      const projectList = document.createElement("div");
      projectList.setAttribute("class","project-list project-dynamic");
      projectList.setAttribute("data-key",newProject.id)
      //DATA KEY TO FETCH ID FROM NEW CLASS ↑↑

      projectList.innerHTML = `

Project name

      `
      container.insertBefore(projectList,createProject);
    }
    appendProject()

  })
}```
</div>
</div>
</p>
<p>I access the property</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>let projectArrayList = [];

class NewProject {
  constructor(title) {
    this.title = title;
  }

  createProjectItem() {
    const projectArray = {
      title: this.title,
      id: Date.now(),
    };
    projectArrayList.push(projectArray)
    console.log(projectArrayList);
  }
}

export default function createProjectFromClass() {
  createProjectList.addEventListener("click",() => {
    // Create a new project from project class
    const Titleinput = document.getElementById("project-title");
    const titleText = Titleinput.value.trim();

    if (titleText !== "") {
      const newProject = new NewProject(titleText);
      newProject.createProjectItem()
      console.log(newProject.id);
      Titleinput.value = "";
    }

    //Append newProject to projects list
    function appendProject() {
      const container = document.querySelector(".projects");
      const createProject = document.querySelector(".create-project")
      const projectList = document.createElement("div");
      projectList.setAttribute("class","project-list project-dynamic");
      projectList.setAttribute("data-key","?????")
      projectList.innerHTML = `
        <p>Project name</p>
        <i class="fa-solid fa-trash-can"></i>
      `
      container.insertBefore(projectList,createProject);
    }
    appendProject()

  })
}</code>```

Body:
I was trying to fetch the ID that has been created from a new class to use it as a data key, but I can't seem to be able to access it. How can be able to do so, kindly help.

My code has a class and a function that uses the class to create a new item and append it onto a main container in my html file.

I want to use the setAttribute method to add a data-key and link the ID that has been created by the function createProjectItem() in the class but it says that the new class(newProject) has not been defined.

class NewProject {
  constructor(title) {
    this.title = title;
  }

  createProjectItem() {
    const projectArray = {
      title: this.title,
      id: Date.now(),
      //ID TO BE ACCESSED ↑↑
    };
    projectArrayList.push(projectArray)
    console.log(projectArrayList);
  }
}

const createProjectList = document.querySelector(".create-projectList");

export default function createProjectFromClass() {
  createProjectList.addEventListener("click",() => {

    //Creates new class
    const Titleinput = document.getElementById("project-title");
    const titleText = Titleinput.value.trim();

    if (titleText !== "") {
      const newProject = new NewProject(titleText);
      newProject.createProjectItem()
      console.log(newProject.id);
      Titleinput.value = "";
    }

    //Append new class to projects list
    function appendProject() {
      const container = document.querySelector(".projects");
      const createProject = document.querySelector(".create-project")
      const projectList = document.createElement("div");
      projectList.setAttribute("class","project-list project-dynamic");
      projectList.setAttribute("data-key",newProject.id)
      //DATA KEY TO FETCH ID FROM NEW CLASS ↑↑

      projectList.innerHTML = `

Project name

      `
      container.insertBefore(projectList,createProject);
    }
    appendProject()

  })
}

I access the property

let projectArrayList = [];

class NewProject {
  constructor(title) {
    this.title = title;
  }

  createProjectItem() {
    const projectArray = {
      title: this.title,
      id: Date.now(),
    };
    projectArrayList.push(projectArray)
    console.log(projectArrayList);
  }
}

export default function createProjectFromClass() {
  createProjectList.addEventListener("click",() => {
    // Create a new project from project class
    const Titleinput = document.getElementById("project-title");
    const titleText = Titleinput.value.trim();

    if (titleText !== "") {
      const newProject = new NewProject(titleText);
      newProject.createProjectItem()
      console.log(newProject.id);
      Titleinput.value = "";
    }

    //Append newProject to projects list
    function appendProject() {
      const container = document.querySelector(".projects");
      const createProject = document.querySelector(".create-project")
      const projectList = document.createElement("div");
      projectList.setAttribute("class","project-list project-dynamic");
      projectList.setAttribute("data-key","?????")
      projectList.innerHTML = `

Project name

      `
      container.insertBefore(projectList,createProject);
    }
    appendProject()

  })
}


问:
Return SQL value based on condition
Trying to get my head around this but I am stumped. Can I use an IIf with a HAVING statement or a CASE?

My current SQL is this:

```<code>    SELECT dbo_forecast.mtl_part_part_nbr,
       SUM(Round(dbo_forecast.forecast_qty)) AS FCST,
       dbo_m8stacd_standards.whse_nbr,
       dbo_m8stacd_standards.statn_cd,
       dbo_m8stacd_standards.prty
INTO   tblforecast77
FROM   dbo_m8stacd_standards
       INNER JOIN dbo_forecast
               ON dbo_m8stacd_standards.part_nbr =
                  dbo_forecast.mtl_part_part_nbr
WHERE  ( ( ( dbo_forecast.type ) = 11
            OR ( dbo_forecast.type ) = 12 )
         AND ( ( dbo_forecast.forecast_month ) = '01'
                OR ( dbo_forecast.forecast_month ) = '02'
                OR ( dbo_forecast.forecast_month ) = '03'
                OR ( dbo_forecast.forecast_month ) = '04'
                OR ( dbo_forecast.forecast_month ) = '05'
                OR ( dbo_forecast.forecast_month ) = '06'
                OR ( dbo_forecast.forecast_month ) = '07'
                OR ( dbo_forecast.forecast_month ) = '08'
                OR ( dbo_forecast.forecast_month ) = '09'
                OR ( dbo_forecast.forecast_month ) = '10'
                OR ( dbo_forecast.forecast_month ) = '11'
                OR ( dbo_forecast.forecast_month ) = '12' ) )
GROUP  BY dbo_forecast.mtl_part_part_nbr,
          dbo_m8stacd_standards.whse_nbr,
          dbo_m8stacd_standards.statn_cd,
          dbo_m8stacd_standards.prty
HAVING ( ( ( dbo_forecast.mtl_part_part_nbr ) = "00104918" )
         AND ( ( dbo_m8stacd_standards.whse_nbr ) = 77 )
         AND ( ( dbo_m8stacd_standards.prty ) = "01"
                OR ( dbo_m8stacd_standards.prty ) = "d" )
         AND ( ( SUM(Round([dbo_forecast].[forecast_qty])) ) > 0 ) );
</code>```

And returns this:

What I want to return is if there is a "D" in prty (for that part number) return the FCST for that, if there is not a prty (for that part number) D return the FCST for prty = "01"

edit: Sorry I should have worded this better. What I want is return one record. The prty=d record if it exists, otherwise the 01 record.

Title: Return SQL value based on condition

Body:
Trying to get my head around this but I am stumped. Can I use an IIf with a HAVING statement or a CASE?

My current SQL is this:

    SELECT dbo_forecast.mtl_part_part_nbr,
       SUM(Round(dbo_forecast.forecast_qty)) AS FCST,
       dbo_m8stacd_standards.whse_nbr,
       dbo_m8stacd_standards.statn_cd,
       dbo_m8stacd_standards.prty
INTO   tblforecast77
FROM   dbo_m8stacd_standards
       INNER JOIN dbo_forecast
               ON dbo_m8stacd_standards.part_nbr =
                  dbo_forecast.mtl_part_part_nbr
WHERE  ( ( ( dbo_forecast.type ) = 11
            OR ( dbo_forecast.type ) = 12 )
         AND ( ( dbo_forecast.forecast_month ) = '01'
                OR ( dbo_forecast.forecast_month ) = '02'
                OR ( dbo_forecast.forecast_month ) = '03'
                OR ( dbo_forecast.forecast_month ) = '04'
                OR ( dbo_forecast.forecast_month ) = '05'
                OR ( dbo_forecast.forecast_month ) = '06'
                OR ( dbo_forecast.forecast_month ) = '07'
                OR ( dbo_forecast.forecast_month ) = '08'
                OR ( dbo_forecast.forecast_month ) = '09'
                OR ( dbo_forecast.forecast_month ) = '10'
                OR ( dbo_forecast.forecast_month ) = '11'
                OR ( dbo_forecast.forecast_month ) = '12' ) )
GROUP  BY dbo_forecast.mtl_part_part_nbr,
          dbo_m8stacd_standards.whse_nbr,
          dbo_m8stacd_standards.statn_cd,
          dbo_m8stacd_standards.prty
HAVING ( ( ( dbo_forecast.mtl_part_part_nbr ) = "00104918" )
         AND ( ( dbo_m8stacd_standards.whse_nbr ) = 77 )
         AND ( ( dbo_m8stacd_standards.prty ) = "01"
                OR ( dbo_m8stacd_standards.prty ) = "d" )
         AND ( ( SUM(Round([dbo_forecast].[forecast_qty])) ) > 0 ) );

And returns this:

What I want to return is if there is a "D" in prty (for that part number) return the FCST for that, if there is not a prty (for that part number) D return the FCST for prty = "01"

edit: Sorry I should have worded this better. What I want is return one record. The prty=d record if it exists, otherwise the 01 record.


问:
How to update data on screen after filtering using Flutter Bloc?
I am learning Flutter now and i have a screen that loading many series characters, and i have an icon in the AppBar showing
ModalBottomSheet and it have many choices to filter to update data with the new chosen ones.
I got the choices and stored the in a List of Strings but i dont know how to pass it to a function in my cubit file and i don't know how to update data using cubit , i tried many ways but didn't work with me.

Here's my code

```<code>import 'package:breakingbad/data/models/breaking_bad_characters.dart';
import 'package:breakingbad/domain/cubit/rick_and_morty_cubit.dart';
import 'package:breakingbad/presentation/character-detail.dart';
import 'package:conditional_builder_null_safety/conditional_builder_null_safety.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

  import '../widgets/character_item.dart';
  import '../widgets/chip_choice.dart';

  class MyHomePage extends StatefulWidget {
  static String id ='home';

    const MyHomePage({Key? key}) : super(key: key);

   @override
   State<MyHomePage> createState() => _MyHomePageState();
   }

   class _MyHomePageState extends State<MyHomePage> {

  @override
  Widget build(BuildContext context) {

  return BlocConsumer<RickAndMortyCubit,RickAndMortyState>(
    listener: (context, state){},
      builder: (context, state) {
        var cubit = RickAndMortyCubit.get(context);
        return Scaffold(
            appBar: AppBar(
              title: const Center(child: Text('Rick And Morty')),
              actions: [
                IconButton(
                  padding: const EdgeInsets.only(right: 25),
                    onPressed: (){
                    showModalBottomSheet(
                        context: context,
                        builder: (context) =>
                            Column(
                              children:  [
                                Container(
                                  alignment: Alignment.center,
                                  color: Colors.black,
                                  width: double.infinity,
                                  height: 50,
                                  child: const Text('Filter Characters',style: TextStyle(color:
      Colors.white,fontSize: 22),),
                                ),
                                const ChoiceChipWidget(),
                              ],
                            )
                    );

                    },
                    icon: const Icon(Icons.filter_list_sharp,size: 40,)),

              ],
            ),
            body: ConditionalBuilder(
               condition: state is RickAndMortyCharsLoaded,
              fallback: (context)=> const Center(child: CircularProgressIndicator()),
              builder: (context) =>  GridView.builder(
                  gridDelegate:  const SliverGridDelegateWithFixedCrossAxisCount(
                    crossAxisCount: 2,
                    childAspectRatio: 2 / 3,
                    crossAxisSpacing: 1,
                    mainAxisSpacing: 1,
                  ),
                  itemCount: cubit.allHuman.length,
                  itemBuilder: (context,index) =>
                      CharacterItem(
                        rickAndMortyCharacters: cubit.allHuman[index],
                        widget:CharacterDetail(rickAndMortyCharacters: cubit.allHuman[index]),
                      )
              ),
            )
            );
      }
  );

   }

 }

import 'package:breakingbad/domain/cubit/rick_and_morty_cubit.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class ChoiceChipWidget extends StatefulWidget {

 const ChoiceChipWidget( {super.key, });

@override
State<ChoiceChipWidget> createState() => _ChoiceChipWidgetState();
}

class _ChoiceChipWidgetState extends State<ChoiceChipWidget> {
 String selectedChoice1 = "";
 String selectedChoice2 = "";
  String selectedChoice3 = "";
  List<String> filter=[];

  @override
 Widget build(BuildContext context) {

  return BlocBuilder<RickAndMortyCubit, RickAndMortyState>(
 builder: (context, state) {
  var cubit = RickAndMortyCubit.get(context);

  return Column(
  children: [
    Chip(
      elevation: 20,
      padding: const EdgeInsets.all(8),
      backgroundColor: Colors.greenAccent[100],
      shadowColor: Colors.black,
      label:  const Text(
        'Gender',
        style: TextStyle(fontSize: 20),
      ), //Text
    ),
    Row(
      children: cubit.gender.map((item){
        return  Container(
          padding: const EdgeInsets.all(2.0),
          child: ChoiceChip(
            label: Text(item),
            labelStyle:  const TextStyle(
                color: Colors.black, fontWeight: FontWeight.bold),
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(22.0),

            ),
            backgroundColor: Colors.grey[300],
            selectedColor: Colors.blue,
            selected: selectedChoice1 == item,
            onSelected: (selected) {
              setState(() {
                selectedChoice1 = item;
                filter.add(selectedChoice1);
              });
            },
          ),
        );
      }).toList()
    ),

    Chip(
      elevation: 20,
      padding: const EdgeInsets.all(8),
      backgroundColor: Colors.greenAccent[100],
      shadowColor: Colors.black,
      label:  const Text(
        'Species',
        style: TextStyle(fontSize: 20),
      ), //Text
    ),
    SingleChildScrollView(
      scrollDirection: Axis.horizontal,
      child: Row(
          children:cubit.species.map((item){
            return  Container(
              padding: const EdgeInsets.all(2.0),
              child: ChoiceChip(
                label: Text(item),
                labelStyle:  const TextStyle(
                  fontSize: 18,
                    color: Colors.black, fontWeight: FontWeight.bold),
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(22.0),

                ),
                backgroundColor: Colors.grey[300],
                selectedColor: Colors.blue,
                selected: selectedChoice2 == item,
                onSelected: (selected) {
                  setState(() {
                    selectedChoice2 = item;
                    filter.add(selectedChoice2);
                  });
                },
              ),
            );
          }).toList()
      ),
    ),

    Chip(
      elevation: 20,
      padding: const EdgeInsets.all(8),
      backgroundColor: Colors.greenAccent[100],
      shadowColor: Colors.black,
      label:  const Text(
        'Statue',
        style: TextStyle(fontSize: 20),
      ), //Text
    ),
    Row(
        children:cubit.statue.map((item){
          return  Container(
            padding: const EdgeInsets.all(2.0),
            child: ChoiceChip(
              label: Text(item),
              labelStyle:  const TextStyle(
                  color: Colors.black, fontWeight: FontWeight.bold),
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(22.0),

              ),
              backgroundColor: Colors.grey[300],
              selectedColor: Colors.blue,
              selected: selectedChoice3 == item,
              onSelected: (selected) {
                setState(() {
                  selectedChoice3 = item;
                  filter.add(selectedChoice3);
                });
              },
            ),
          );
        }).toList()
    ),
    SizedBox(height: 4,),
    InkWell(
      onTap: (){
       // here i want to apply changes
        Navigator.pop(context);
      },
      child: Chip(
        elevation: 20,
        padding: const EdgeInsets.all(8),
        backgroundColor: Colors.greenAccent[100],
        shadowColor: Colors.black,
        label:  const Text(
          'apply',
          style: TextStyle(fontSize: 20),
        ), //Text
      ),
    ),

  ],
  );
  },
);
 }
}
</code>```

I have two main functions, the first one get all characters to the home screen:

```<code> List<Characters>?
 getAllCharacters(){
  myRepository.
  getAllCharacters().then(
  (allCharacters)=>
  this.allCharacters =
   allCharacters;
   );
     return allCharacters;
   }
</code>```

and the second function that takes a parameter of List of Strings which i suppose to get them from the filtering in bottomSheet;

```<code>  List<Characters>?
  getFilteredCharacters
  (List<String> list){
  myRepository
  .getFilteredCharacters(list)
  .then((filteredCharacters)=>
   this.filteredCharacters =
   filteredCharacters;
    );
   return filteredCharacters;
   }
</code>```

Anyone could help me in this issue?

Body:
I am learning Flutter now and i have a screen that loading many series characters, and i have an icon in the AppBar showing
ModalBottomSheet and it have many choices to filter to update data with the new chosen ones.
I got the choices and stored the in a List of Strings but i dont know how to pass it to a function in my cubit file and i don't know how to update data using cubit , i tried many ways but didn't work with me.

Here's my code

import 'package:breakingbad/data/models/breaking_bad_characters.dart';
import 'package:breakingbad/domain/cubit/rick_and_morty_cubit.dart';
import 'package:breakingbad/presentation/character-detail.dart';
import 'package:conditional_builder_null_safety/conditional_builder_null_safety.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

  import '../widgets/character_item.dart';
  import '../widgets/chip_choice.dart';

  class MyHomePage extends StatefulWidget {
  static String id ='home';

    const MyHomePage({Key? key}) : super(key: key);

   @override
   State<MyHomePage> createState() => _MyHomePageState();
   }

   class _MyHomePageState extends State<MyHomePage> {

  @override
  Widget build(BuildContext context) {

  return BlocConsumer<RickAndMortyCubit,RickAndMortyState>(
    listener: (context, state){},
      builder: (context, state) {
        var cubit = RickAndMortyCubit.get(context);
        return Scaffold(
            appBar: AppBar(
              title: const Center(child: Text('Rick And Morty')),
              actions: [
                IconButton(
                  padding: const EdgeInsets.only(right: 25),
                    onPressed: (){
                    showModalBottomSheet(
                        context: context,
                        builder: (context) =>
                            Column(
                              children:  [
                                Container(
                                  alignment: Alignment.center,
                                  color: Colors.black,
                                  width: double.infinity,
                                  height: 50,
                                  child: const Text('Filter Characters',style: TextStyle(color:
      Colors.white,fontSize: 22),),
                                ),
                                const ChoiceChipWidget(),
                              ],
                            )
                    );

                    },
                    icon: const Icon(Icons.filter_list_sharp,size: 40,)),

              ],
            ),
            body: ConditionalBuilder(
               condition: state is RickAndMortyCharsLoaded,
              fallback: (context)=> const Center(child: CircularProgressIndicator()),
              builder: (context) =>  GridView.builder(
                  gridDelegate:  const SliverGridDelegateWithFixedCrossAxisCount(
                    crossAxisCount: 2,
                    childAspectRatio: 2 / 3,
                    crossAxisSpacing: 1,
                    mainAxisSpacing: 1,
                  ),
                  itemCount: cubit.allHuman.length,
                  itemBuilder: (context,index) =>
                      CharacterItem(
                        rickAndMortyCharacters: cubit.allHuman[index],
                        widget:CharacterDetail(rickAndMortyCharacters: cubit.allHuman[index]),
                      )
              ),
            )
            );
      }
  );

   }

 }

import 'package:breakingbad/domain/cubit/rick_and_morty_cubit.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class ChoiceChipWidget extends StatefulWidget {

 const ChoiceChipWidget( {super.key, });

@override
State<ChoiceChipWidget> createState() => _ChoiceChipWidgetState();
}

class _ChoiceChipWidgetState extends State<ChoiceChipWidget> {
 String selectedChoice1 = "";
 String selectedChoice2 = "";
  String selectedChoice3 = "";
  List<String> filter=[];

  @override
 Widget build(BuildContext context) {

  return BlocBuilder<RickAndMortyCubit, RickAndMortyState>(
 builder: (context, state) {
  var cubit = RickAndMortyCubit.get(context);

  return Column(
  children: [
    Chip(
      elevation: 20,
      padding: const EdgeInsets.all(8),
      backgroundColor: Colors.greenAccent[100],
      shadowColor: Colors.black,
      label:  const Text(
        'Gender',
        style: TextStyle(fontSize: 20),
      ), //Text
    ),
    Row(
      children: cubit.gender.map((item){
        return  Container(
          padding: const EdgeInsets.all(2.0),
          child: ChoiceChip(
            label: Text(item),
            labelStyle:  const TextStyle(
                color: Colors.black, fontWeight: FontWeight.bold),
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(22.0),

            ),
            backgroundColor: Colors.grey[300],
            selectedColor: Colors.blue,
            selected: selectedChoice1 == item,
            onSelected: (selected) {
              setState(() {
                selectedChoice1 = item;
                filter.add(selectedChoice1);
              });
            },
          ),
        );
      }).toList()
    ),

    Chip(
      elevation: 20,
      padding: const EdgeInsets.all(8),
      backgroundColor: Colors.greenAccent[100],
      shadowColor: Colors.black,
      label:  const Text(
        'Species',
        style: TextStyle(fontSize: 20),
      ), //Text
    ),
    SingleChildScrollView(
      scrollDirection: Axis.horizontal,
      child: Row(
          children:cubit.species.map((item){
            return  Container(
              padding: const EdgeInsets.all(2.0),
              child: ChoiceChip(
                label: Text(item),
                labelStyle:  const TextStyle(
                  fontSize: 18,
                    color: Colors.black, fontWeight: FontWeight.bold),
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(22.0),

                ),
                backgroundColor: Colors.grey[300],
                selectedColor: Colors.blue,
                selected: selectedChoice2 == item,
                onSelected: (selected) {
                  setState(() {
                    selectedChoice2 = item;
                    filter.add(selectedChoice2);
                  });
                },
              ),
            );
          }).toList()
      ),
    ),

    Chip(
      elevation: 20,
      padding: const EdgeInsets.all(8),
      backgroundColor: Colors.greenAccent[100],
      shadowColor: Colors.black,
      label:  const Text(
        'Statue',
        style: TextStyle(fontSize: 20),
      ), //Text
    ),
    Row(
        children:cubit.statue.map((item){
          return  Container(
            padding: const EdgeInsets.all(2.0),
            child: ChoiceChip(
              label: Text(item),
              labelStyle:  const TextStyle(
                  color: Colors.black, fontWeight: FontWeight.bold),
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(22.0),

              ),
              backgroundColor: Colors.grey[300],
              selectedColor: Colors.blue,
              selected: selectedChoice3 == item,
              onSelected: (selected) {
                setState(() {
                  selectedChoice3 = item;
                  filter.add(selectedChoice3);
                });
              },
            ),
          );
        }).toList()
    ),
    SizedBox(height: 4,),
    InkWell(
      onTap: (){
       // here i want to apply changes
        Navigator.pop(context);
      },
      child: Chip(
        elevation: 20,
        padding: const EdgeInsets.all(8),
        backgroundColor: Colors.greenAccent[100],
        shadowColor: Colors.black,
        label:  const Text(
          'apply',
          style: TextStyle(fontSize: 20),
        ), //Text
      ),
    ),

  ],
  );
  },
);
 }
}

I have two main functions, the first one get all characters to the home screen:

 List<Characters>?
 getAllCharacters(){
  myRepository.
  getAllCharacters().then(
  (allCharacters)=>
  this.allCharacters =
   allCharacters;
   );
     return allCharacters;
   }

and the second function that takes a parameter of List of Strings which i suppose to get them from the filtering in bottomSheet;

  List<Characters>?
  getFilteredCharacters
  (List<String> list){
  myRepository
  .getFilteredCharacters(list)
  .then((filteredCharacters)=>
   this.filteredCharacters =
   filteredCharacters;
    );
   return filteredCharacters;
   }

Anyone could help me in this issue?


问:
iOS How to receive and store system NSNotification in a SwiftUI application?
I want to write an app where I create a database of all the changes made in one setting from UIKit.
The flow in SwiftUI:

UIKit posts a notification (static let Name_StatusDidChangeNotification: NSNotifiaction.Name)

My Swift App saves current DateTime in Core Data - both while in foreground and background mode

How should I design my app to be able to do this?

This is my first time creating an iOS app. From my research I think that:

I need to create  DataController : ObservableObject
-> to controll the data  being loaded and saved to the device.

I need to create  AppDelegate: NSObject, UIApplicationDelegate {}

In my @main struct I need to add

```<code>@UIApplicationDelegateAdaptor(Appdelegate.self) var appDelegate
</code>```

I got stuck in the middle because I do not know how to configure my notification center. Where it should be added?

```<code>NotificationCenter.default
                    .addObserver(self,
                      selector:#selector(mySelector),
                 name: NSNotification.Name("Name_StatusDidChangeNotification"),
                      object:nil)

@objc func mySelector(_ notification: Notification) {
//saving DateTime into Storage
}

</code>```

Body:
I want to write an app where I create a database of all the changes made in one setting from UIKit.
The flow in SwiftUI:

UIKit posts a notification (static let Name_StatusDidChangeNotification: NSNotifiaction.Name)

My Swift App saves current DateTime in Core Data - both while in foreground and background mode

How should I design my app to be able to do this?

This is my first time creating an iOS app. From my research I think that:

I need to create  DataController : ObservableObject
-> to controll the data  being loaded and saved to the device.

I need to create  AppDelegate: NSObject, UIApplicationDelegate {}

In my @main struct I need to add

@UIApplicationDelegateAdaptor(Appdelegate.self) var appDelegate

I got stuck in the middle because I do not know how to configure my notification center. Where it should be added?

NotificationCenter.default
                    .addObserver(self,
                      selector:#selector(mySelector),
                 name: NSNotification.Name("Name_StatusDidChangeNotification"),
                      object:nil)

@objc func mySelector(_ notification: Notification) {
//saving DateTime into Storage
}


问:
Data Vault model for an insurance use case
I am currently working on an insurance use case and would like to apply a Data Vault 2.0 modeling approach to solve this challenge.

Following scenrio:

A contract was initially created on 28 March but will be effective on 01 April.
Now in June there was an adjustment and the premium was increased from 100 to 125 for July.
Again there was an adjustment in November and premium was increased from 125 to 150 for December.

To represent the different effective periods of the contract,
possible approach could be used for the satellite table with multiple active rows.

My experience with Data Vault has always been limited to use cases with one active record in the satellite table.

Question:
This feels not like real Data Vault 2.0 modeling approach to me.
How this use case could be simplified and solved with a Data Vault 2.0 modeling approach? How could the data model look like?
Is it even possible to apply an INSERT-only modeling approach on that use case?


问:
PHP Salesforce. How would you Format a Picklist That is Restricted to only select one value
I need to figure out how to add a picklist value that is restricted to one value. So if I had a selection Between Red, Green, Blue. How would I pass that value as a pick list in a Post. Consider the following...

If Color_c is a picklist that has the option of Red, Green, and Blue. How would I selected just Blue? The labels and values are literally the same.

I am using https://github.com/omniphx/forrest

The following is the result if I just a straight String value.

INVALID_CROSS_REFERENCE_KEY:

```<code>Forrest::sobjects('Car__c', [
    'method' => 'post',
    'body' => [
        // Step 1
        'Name' => 'Mustang',
        'Color_c' => 'Blue',
    ],
    'headers' => [
        'Sforce-Auto-Assign' => 'XXXXXXXXXXXXXXXXXXX'
    ]

]);
</code>```

I am expecting a result.

Body:
I need to figure out how to add a picklist value that is restricted to one value. So if I had a selection Between Red, Green, Blue. How would I pass that value as a pick list in a Post. Consider the following...

If Color_c is a picklist that has the option of Red, Green, and Blue. How would I selected just Blue? The labels and values are literally the same.

I am using https://github.com/omniphx/forrest

The following is the result if I just a straight String value.

INVALID_CROSS_REFERENCE_KEY:

Forrest::sobjects('Car__c', [
    'method' => 'post',
    'body' => [
        // Step 1
        'Name' => 'Mustang',
        'Color_c' => 'Blue',
    ],
    'headers' => [
        'Sforce-Auto-Assign' => 'XXXXXXXXXXXXXXXXXXX'
    ]

]);

I am expecting a result.


问:
How to validate Nested Serializer in Django Rest Framework
I have ReviewRatings and ReviewImages models in which ReviewImages is ForeignKey to ReviewRatings so that an user can upload single or multiple images along with reviews.
I have overridden the create method for ReviewRatings in ReviewRatingSerializer and creates ReviewImages in it also. I Have ReviewImagesSerializer also. So My doubt is How do I validate the images am looping through before saving it.

Is there anyway to call ReviewImagesSerializer in create method of ReviewRatingSerializer
to validate the files?

#Serializer.py

```<code>
class ReviewImagesSerializer(ModelSerializer):
    class Meta:
        model = ReviewImages
        fields = ["images"]

class ReviewSerializer(ModelSerializer):
    user = SerializerMethodField()
    review_images = ReviewImagesSerializer(many=True, required=False)

    class Meta:
        model = ReviewRatings
        fields = [
            "user",
            "rating",
            "review",
            "created_at",
            "updated_at",
            "review_images",
        ]

    def get_user(self, obj):
        return f"{obj.user.first_name} {obj.user.last_name}"

    def create(self, validated_data):
        review_images = self.context["images"]
        reviews = ReviewRatings.objects.create(**validated_data)
        for image in review_images:
            ReviewImages.objects.create(review=reviews, images=image)
        return reviews

</code>```

Body:
I have ReviewRatings and ReviewImages models in which ReviewImages is ForeignKey to ReviewRatings so that an user can upload single or multiple images along with reviews.
I have overridden the create method for ReviewRatings in ReviewRatingSerializer and creates ReviewImages in it also. I Have ReviewImagesSerializer also. So My doubt is How do I validate the images am looping through before saving it.

Is there anyway to call ReviewImagesSerializer in create method of ReviewRatingSerializer
to validate the files?

#Serializer.py

class ReviewImagesSerializer(ModelSerializer):
    class Meta:
        model = ReviewImages
        fields = ["images"]

class ReviewSerializer(ModelSerializer):
    user = SerializerMethodField()
    review_images = ReviewImagesSerializer(many=True, required=False)

    class Meta:
        model = ReviewRatings
        fields = [
            "user",
            "rating",
            "review",
            "created_at",
            "updated_at",
            "review_images",
        ]

    def get_user(self, obj):
        return f"{obj.user.first_name} {obj.user.last_name}"

    def create(self, validated_data):
        review_images = self.context["images"]
        reviews = ReviewRatings.objects.create(**validated_data)
        for image in review_images:
            ReviewImages.objects.create(review=reviews, images=image)
        return reviews


问:
Entity Framework Queries For Complicated JSON Documents (npgsql)
I am handling legacy (old) JSON files that we are now uploading to a database that was built using code-first EF Core (with the JSON elements saved as a jsonb field in a postgresql db, represented as JsonDocument properties in the EF classes).  We want to be able to query these massive documents against any of the JSON's many properties. I've been very interested in the excellent docs here https://www.npgsql.org/efcore/mapping/json.html?tabs=data-annotations%2Cpoco, but the problem in our case is that our JSON has incredibly complicated hierarchies.

According to the npgsql/EF doc above, a way to do this for "shallow" json hierarchies would be something like:

myDbContext.MyClass
.Where(e => e.JsonDocumentField.RootElement.GetProperty("FieldToSearch").GetString() == "SearchTerm")
.ToList();

But that only works if  is directly under the root of the JSONDocument. If the doc is structed like, say

```<code> {"A": {
   ...
     "B": {
       ...
          "C": {
            ...
               "FieldToSearch":
    <snip>
</code>```

Then the above query won't work. There is an alternative to map our JSON to an actual POCO model, but this JSON structure (a) may change and (b) is truly massive and would result in some ridiculously complicated objects.

Right now, I'm building SQL strings using field configurations where I save strings to find the fields I want using psql's JSON querying language
Example:
"(JSONDocumentField->'A'->'B'->'C'->>'FieldToSearch')"

and then using that sql against the DB using

myDbContext.MyClass.FromSqlRaw(sql).ToList();

This is hacky and I'd much rather do it in a method call. Is there a way to force JsonDocument's GetProperty call to drill down into the hierarchy to find the first/any instance of the property name in question (or another method I'm not aware of)?

Thanks!

Body:
I am handling legacy (old) JSON files that we are now uploading to a database that was built using code-first EF Core (with the JSON elements saved as a jsonb field in a postgresql db, represented as JsonDocument properties in the EF classes).  We want to be able to query these massive documents against any of the JSON's many properties. I've been very interested in the excellent docs here https://www.npgsql.org/efcore/mapping/json.html?tabs=data-annotations%2Cpoco, but the problem in our case is that our JSON has incredibly complicated hierarchies.

According to the npgsql/EF doc above, a way to do this for "shallow" json hierarchies would be something like:

myDbContext.MyClass
.Where(e => e.JsonDocumentField.RootElement.GetProperty("FieldToSearch").GetString() == "SearchTerm")
.ToList();

But that only works if  is directly under the root of the JSONDocument. If the doc is structed like, say

 {"A": {
   ...
     "B": {
       ...
          "C": {
            ...
               "FieldToSearch":
    <snip>

Then the above query won't work. There is an alternative to map our JSON to an actual POCO model, but this JSON structure (a) may change and (b) is truly massive and would result in some ridiculously complicated objects.

Right now, I'm building SQL strings using field configurations where I save strings to find the fields I want using psql's JSON querying language
Example:
"(JSONDocumentField->'A'->'B'->'C'->>'FieldToSearch')"

and then using that sql against the DB using

myDbContext.MyClass.FromSqlRaw(sql).ToList();

This is hacky and I'd much rather do it in a method call. Is there a way to force JsonDocument's GetProperty call to drill down into the hierarchy to find the first/any instance of the property name in question (or another method I'm not aware of)?

Thanks!


问:
TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'
So I have an object in typescript:

```<code>const columnWidthObject = {
  '1': 20,
  '2': 20,
  '3': 30,
  '4' : 20,
}
</code>```

and I want to loop through it key : value pairs

```<code>Object.keys(columnWidthObject).forEach((key) => {
 console.log(columnWidthObject[key])
})
</code>```

yet I recieve error:

also when I hover over columnWithObject I get following type:

```<code>const columnWidthObject: {
    [key: number]: number;
}
</code>```

I tried to add some type defenition to Object.entries but I recieved another error.

Will be glad for any help and explanation.

Body:
So I have an object in typescript:

const columnWidthObject = {
  '1': 20,
  '2': 20,
  '3': 30,
  '4' : 20,
}

and I want to loop through it key : value pairs

Object.keys(columnWidthObject).forEach((key) => {
 console.log(columnWidthObject[key])
})

yet I recieve error:

also when I hover over columnWithObject I get following type:

const columnWidthObject: {
    [key: number]: number;
}

I tried to add some type defenition to Object.entries but I recieved another error.

Will be glad for any help and explanation.


问:
Any way to disable hive-style partitioning?
I am writing an apache iceberg table that is synced to a metastore. When generating tables, the partitioning appears as hive-style when I'd prefer it to be just the singular value. I also have tested hudi tables, which comes with an inherent way to disable hive-style partitioning. I understand that this may not be the best solution / best practice, but it's the outcome that I need currently.

Example Output:

directory/year=2022/month=12/day=07/parquet.file

Preferred Output:

directory/2022/12/07/parquet.file

Since I can find no way of disabling this formatting via iceberg table properties, is there any way to do this via my hive site config? Thanks in advance!

I have tried researching the issue, but have found very little information on other people attempting the same thing.


问:
gdb.execute('ptype..) command does not display enum type for an array whose type is enum
In my python script, when I write gdb.execute('ptype..) command it does not output the enum type for an array whose type is enum. Instead it outputs all the enum members but does not output the name of the enum type. Any ideas how to get the enum type name?

types_names = gdb.execute('ptype %s' % stripped_type.tag, to_string=True)

I wrote:
types_names = gdb.execute('ptype %s' % stripped_type.tag, to_string=True)

I get:

(Pdb) p types_names
'type = struct Vd3d::BoxConfidenceData {\n    enum : unsigned int {Vd3d::SC_NOT_INITIALIZED,   Vd3d::SC_BAD_STICK, Vd3d::SC_PROBABLY_BAD_STICK, Vd3d::SC_PROBABLY_GOOD_STICK, Vd3d::SC_GOOD_STICK, Vd3d::NUM_SC} stickConf[4];\n

Instead of getting:
type = struct Vd3d::BoxConfidenceData {\n   Vd3d::STICK_CONFIDENCE stickConf[4];


问:
Flutter Spinkit for webview
spinning indicator on every page is not working. it is just working on the front page of the webview

Can you please mention the spinkit code for webview?
If we visit any page in webview, it should show spinning indicator on every page.

Title: Flutter Spinkit for webview


问:
Pine Script V5 Find high from Zig Zag?
I want to draw only the peak points according to the zigzag pattern. How can I draw these lines up to this next peak by setting the retracement percentage of lookback candles to 20%?
enter image description here</p>

Title: Pine Script V5 Find high from Zig Zag?


问:
When Creating a CSS Snippet to modify ObsidianMD's bullet list's bullets, why does the class '.cm-list-4' work?
Can someone explain to me why when modifying the style of bullet lists, you can only go three levels deep using .cm-list-n where n is level?

The following doesn't work:

```<code>.cm-list-4 .list-bullet:before {
    content: '\25AA';
}
</code>```

This, however does:

```<code>.HyperMD-list-line-4 .list-bullet:before {
    content: '\2024';
}
</code>```

I'm still relatively novice in CSS styling. Using the Developer tools, I see that at the fourth level it cycles back to using '.cm-list-1' -- is this an inherent mechanic of how Obsidian creates the lists?

CSS Inspection View of Fourth Level Bullet

Is .HyperMD-list-line a parent of .cm-list-n and has precedence such that .HyperMD-list-line-4 overrides .cm-list-1 at the fourth level or something along those lines?

I attempted to dissect the source CSS and app.css to understand better how ObsidianMD applies styling but I'm still novice at CSS so my understanding is a bit shaky.

Body:
Can someone explain to me why when modifying the style of bullet lists, you can only go three levels deep using .cm-list-n where n is level?

The following doesn't work:

.cm-list-4 .list-bullet:before {
    content: '\25AA';
}

This, however does:

.HyperMD-list-line-4 .list-bullet:before {
    content: '\2024';
}

I'm still relatively novice in CSS styling. Using the Developer tools, I see that at the fourth level it cycles back to using '.cm-list-1' -- is this an inherent mechanic of how Obsidian creates the lists?

CSS Inspection View of Fourth Level Bullet

Is .HyperMD-list-line a parent of .cm-list-n and has precedence such that .HyperMD-list-line-4 overrides .cm-list-1 at the fourth level or something along those lines?

I attempted to dissect the source CSS and app.css to understand better how ObsidianMD applies styling but I'm still novice at CSS so my understanding is a bit shaky.