从Heroku,当我点击“打开应用程序”时,我会进入一个屏幕,显示以下消息:
应用错误
应用程序中发生错误,无法提供您的页面。如果您是应用程序所有者,请查看日志以了解详细信息。您可以在Heroku CLI中使用以下命令执行此操作
heroku logs --tail
当我在终端中运行这个命令时,我得到以下结果:
2023-05-02T20:55:46.008048+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=stark-brushlands-01940.herokuapp.com request_id=089a1f69-2776-42f8-96fe-6483816d7db6 fwd="76.100.146.70" dyno= connect= service= status=503 bytes= protocol=https
2023-05-02T20:55:46.296015+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=stark-brushlands-01940.herokuapp.com request_id=7eedd68b-4683-4ab5-ae47-35f00fb6b958 fwd="76.100.146.70" dyno= connect= service= status=503 bytes= protocol=https
下面是对堆栈跟踪的更详细的了解:
2023-05-02T21:46:58.098960+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=stark-brushlands-01940.herokuapp.com request_id=a0d2bfa4-b583-4cd4-91d8-aa4524886c18 fwd="76.100.146.70" dyno= connect= service= status=503 bytes= protocol=https
2023-05-02T21:46:58.380588+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=stark-brushlands-01940.herokuapp.com request_id=4badb527-3741-4426-9bee-c6ca4d8fd3f2 fwd="76.100.146.70" dyno= connect= service= status=503 bytes= protocol=https
2023-05-02T21:47:14.133483+00:00 heroku[web.1]: State changed from crashed to starting
2023-05-02T21:47:22.910963+00:00 heroku[web.1]: Starting process with command `bin/rails server -p ${PORT:-5000} -e production`
2023-05-02T21:47:25.776952+00:00 app[web.1]: => Booting Puma
2023-05-02T21:47:25.776974+00:00 app[web.1]: => Rails 6.1.4.6 application starting in production
2023-05-02T21:47:25.776974+00:00 app[web.1]: => Run `bin/rails server --help` for more startup options
2023-05-02T21:47:25.777930+00:00 app[web.1]: Exiting
2023-05-02T21:47:25.778017+00:00 app[web.1]: /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/realpath_cache.rb:17:in `dirname': no implicit conversion of nil into String (TypeError)
2023-05-02T21:47:25.778020+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/realpath_cache.rb:17:in `realpath'
2023-05-02T21:47:25.778023+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/realpath_cache.rb:7:in `block in initialize'
2023-05-02T21:47:25.778023+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/realpath_cache.rb:11:in `call'
2023-05-02T21:47:25.778024+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `require_relative'
2023-05-02T21:47:25.778028+00:00 app[web.1]: from config.ru:3:in `block in <main>'
2023-05-02T21:47:25.778030+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/builder.rb:116:in `eval'
2023-05-02T21:47:25.778032+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/builder.rb:116:in `new_from_string'
2023-05-02T21:47:25.778032+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/builder.rb:105:in `load_file'
2023-05-02T21:47:25.778033+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/builder.rb:66:in `parse_file'
2023-05-02T21:47:25.778033+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/server.rb:349:in `build_app_and_options_from_config'
2023-05-02T21:47:25.778033+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/server.rb:249:in `app'
2023-05-02T21:47:25.778034+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/server.rb:422:in `wrapped_app'
2023-05-02T21:47:25.778034+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/server.rb:312:in `block in start'
2023-05-02T21:47:25.778034+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/server.rb:379:in `handle_profiling'
2023-05-02T21:47:25.778034+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/server.rb:311:in `start'
2023-05-02T21:47:25.778034+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/commands/server/server_command.rb:39:in `start'
2023-05-02T21:47:25.778034+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/commands/server/server_command.rb:144:in `block in perform'
2023-05-02T21:47:25.778035+00:00 app[web.1]: from <internal:kernel>:90:in `tap'
2023-05-02T21:47:25.778036+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/commands/server/server_command.rb:135:in `perform'
2023-05-02T21:47:25.778044+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'
2023-05-02T21:47:25.778044+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'
2023-05-02T21:47:25.778051+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
2023-05-02T21:47:25.778052+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/command/base.rb:69:in `perform'
2023-05-02T21:47:25.778059+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/command.rb:48:in `invoke'
2023-05-02T21:47:25.778059+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/commands.rb:18:in `<main>'
2023-05-02T21:47:25.778060+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
2023-05-02T21:47:25.778076+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
2023-05-02T21:47:25.778076+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
2023-05-02T21:47:25.778077+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
2023-05-02T21:47:25.778077+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
2023-05-02T21:47:25.778079+00:00 app[web.1]: from bin/rails:4:in `<main>'
2023-05-02T21:47:26.022304+00:00 heroku[web.1]: Process exited with status 1
2023-05-02T21:47:26.060411+00:00 heroku[web.1]: State changed from starting to crashed
2023-05-02T21:47:26.064963+00:00 heroku[web.1]: State changed from crashed to starting
2023-05-02T21:47:34.265381+00:00 heroku[web.1]: Starting process with command `bin/rails server -p ${PORT:-5000} -e production`
2023-05-02T21:47:35.951605+00:00 app[web.1]: => Booting Puma
2023-05-02T21:47:35.951635+00:00 app[web.1]: => Rails 6.1.4.6 application starting in production
2023-05-02T21:47:35.951635+00:00 app[web.1]: => Run `bin/rails server --help` for more startup options
2023-05-02T21:47:35.952460+00:00 app[web.1]: Exiting
2023-05-02T21:47:35.952519+00:00 app[web.1]: /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/realpath_cache.rb:17:in `dirname': no implicit conversion of nil into String (TypeError)
2023-05-02T21:47:35.952522+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/realpath_cache.rb:17:in `realpath'
2023-05-02T21:47:35.952524+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/realpath_cache.rb:7:in `block in initialize'
2023-05-02T21:47:35.952525+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/realpath_cache.rb:11:in `call'
2023-05-02T21:47:35.952525+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `require_relative'
2023-05-02T21:47:35.952528+00:00 app[web.1]: from config.ru:3:in `block in <main>'
2023-05-02T21:47:35.952530+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/builder.rb:116:in `eval'
2023-05-02T21:47:35.952532+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/builder.rb:116:in `new_from_string'
2023-05-02T21:47:35.952533+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/builder.rb:105:in `load_file'
2023-05-02T21:47:35.952533+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/builder.rb:66:in `parse_file'
2023-05-02T21:47:35.952534+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/server.rb:349:in `build_app_and_options_from_config'
2023-05-02T21:47:35.952534+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/server.rb:249:in `app'
2023-05-02T21:47:35.952535+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/server.rb:422:in `wrapped_app'
2023-05-02T21:47:35.952543+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/server.rb:312:in `block in start'
2023-05-02T21:47:35.952543+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/server.rb:379:in `handle_profiling'
2023-05-02T21:47:35.952543+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/server.rb:311:in `start'
2023-05-02T21:47:35.952544+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/commands/server/server_command.rb:39:in `start'
2023-05-02T21:47:35.952544+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/commands/server/server_command.rb:144:in `block in perform'
2023-05-02T21:47:35.952545+00:00 app[web.1]: from <internal:kernel>:90:in `tap'
2023-05-02T21:47:35.952553+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/commands/server/server_command.rb:135:in `perform'
2023-05-02T21:47:35.952553+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'
2023-05-02T21:47:35.952554+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'
2023-05-02T21:47:35.952554+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
2023-05-02T21:47:35.952555+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/command/base.rb:69:in `perform'
2023-05-02T21:47:35.952556+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/command.rb:48:in `invoke'
2023-05-02T21:47:35.952563+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/commands.rb:18:in `<main>'
2023-05-02T21:47:35.952563+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
2023-05-02T21:47:35.952565+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
2023-05-02T21:47:35.952565+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
2023-05-02T21:47:35.952566+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
2023-05-02T21:47:35.952567+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
2023-05-02T21:47:35.952567+00:00 app[web.1]: from bin/rails:4:in `<main>'
2023-05-02T21:47:36.141842+00:00 heroku[web.1]: Process exited with status 1
2023-05-02T21:47:36.218370+00:00 heroku[web.1]: State changed from starting to crashed
我正在遵循Michael Hartl的Ruby on Rails教程,但它建议我应该启动并运行应用程序而不会出现问题。我一直无法弄清楚为什么我的应用程序崩溃。
我已经多次尝试使用heroku restart
命令,并在Gemfile.lock中添加了x86_64-linux
作为PLATFORM。我不知道问题是什么,也不知道如何进一步解决。
我尝试了在Stack Overflow上找到的其他建议,但没有一个解决了这个问题。
1条答案
按热度按时间lp0sw83n1#
我能解决这个问题--我不是100%确定是什么解决了它。我把我的Gemfile换成了最新的Hartl's Github page,更新了我的Ruby版本以匹配他的(3.1.2)运行的
bundle update
,把更新后的Gemfile.lock推送到Git和Heroku,现在Heroku应用程序可以按预期工作了。