部署Heroku时遇到问题(应用错误)

时间:2020-01-09 05:40:26

标签: heroku

我正在尝试在Heroku上部署我的后端。我已经尝试根据堆栈溢出的内容进行调试,但仍然遇到问题。

我的步骤: 1. heroku运行rails db:migrate 2. heroku运行rails db:seed,出现错误“ Rest:Client 504” 3. heroku打开“应用程序错误” 4. heroku日志--tail,我得到错误代码H10“应用程序崩溃” 5. heroku ps“崩溃” 6.然后,我运行“ heroku run rails c”以尝试缩小错误。

2020-01-09T05:14:50.031813+00:00 heroku[run.3751]: Awaiting client
2020-01-09T05:14:50.090305+00:00 heroku[run.3751]: Starting process with command `rails c`
2020-01-09T05:14:58.899663+00:00 heroku[run.3751]: State changed from up to complete
2020-01-09T05:14:58.883813+00:00 heroku[run.3751]: Process exited with status 1
2020-01-09T05:29:57.353967+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=abibas-ecommerce.herokuapp.com request_id=607ed6a1-35d9-4dac-9127-aa699de2ead3 fwd="66.108.54.163" dyno= connect= service= status=503 bytes= protocol=https
2020-01-09T05:29:57.931972+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=abibas-ecommerce.herokuapp.com request_id=b2294faf-83c2-4c80-8519-b9f798551e29 fwd="66.108.54.163" dyno= connect= service= status=503 bytes= protocol=https```

When I run "heroku run rails c" I get this error. 

``` Traceback (most recent call last):
        62: from /app/bin/rails:9:in `<main>'
        61: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
        60: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        59: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `block in require'
        58: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        57: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        56: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        55: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        54: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        53: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/commands.rb:18:in `<main>'
        52: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/command.rb:46:in `invoke'
        51: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/command/base.rb:65:in `perform'
        50: from /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        49: from /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        48: from /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        47: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/commands/console/console_command.rb:101:in `perform'
        46: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
        45: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/command/actions.rb:28:in `require_environment!'
        44: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/application.rb:339:in `require_environment!'
        43: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `require'
        42: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        41: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:325:in `block in require'
        40: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/kernel.rb:23:in `require'
        39: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        38: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        37: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        36: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        35: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        34: from /app/config/environment.rb:5:in `<main>'
        33: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/application.rb:363:in `initialize!'
        32: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:60:in `run_initializers'
        31: from /app/vendor/ruby-2.6.1/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
        30: from /app/vendor/ruby-2.6.1/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
        29: from /app/vendor/ruby-2.6.1/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
        28: from /app/vendor/ruby-2.6.1/lib/ruby/2.6.0/tsort.rb:347:in `call'
        27: from /app/vendor/ruby-2.6.1/lib/ruby/2.6.0/tsort.rb:347:in `each'
        26: from /app/vendor/ruby-2.6.1/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
        25: from /app/vendor/ruby-2.6.1/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
        24: from /app/vendor/ruby-2.6.1/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        23: from /app/vendor/ruby-2.6.1/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
        22: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:61:in `block in run_initializers'
        21: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `run'
        20: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `instance_exec'
        19: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.1/lib/rails/application/finisher.rb:122:in `block in <module:Finisher>'
        18: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/loader.rb:449:in `eager_load_all'
        17: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/loader.rb:449:in `each'
        16: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/loader.rb:338:in `eager_load'
        15: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/loader.rb:338:in `synchronize'
        14: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/loader.rb:346:in `block in eager_load'
        13: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/loader.rb:682:in `ls'
        12: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/loader.rb:682:in `foreach'
        11: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/loader.rb:685:in `block in ls'
        10: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/loader.rb:351:in `block (2 levels) in eager_load'
         9: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/loader.rb:351:in `const_get'
         8: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/kernel.rb:16:in `require'
         7: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
         6: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
         5: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
         4: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
         3: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
         2: from /app/app/controllers/orders_controller.rb:1:in `<main>'
         1: from /app/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.2.1/lib/zeitwerk/kernel.rb:23:in `require'
/app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:33:in `require': cannot load such file -- Date (LoadError)```

any help is appreciated. Thanks!

0 个答案:

没有答案