繁体   English   中英

在 Heroku 上的 Rails 应用程序上部署 ruby 成功但应用程序无法启动,显示应用程序错误

[英]Deployed ruby on rails App on Heroku Successfully but app won't start, Displaying Application error

最初,问题是“无法通过 Bundler 安装 gems”。 我通过使用此行输入来修复

`bundle lock --add-platform x86_64-linux`

然后添加并提交到 git,也在 heroku 上更新它,但我无法启动应用程序我知道你会建议我检查日志,但我是 heroku 的新手,我很难从应用程序部署中找到错误或如何解决日志,例如从我的日志中获取 503 错误:

2022-08-09T06:31:41.767338+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=examplerails.herokuapp.com request_id=981a1409-1e70-492c-a2ea-081a06f72ecf fwd="102.89.41.87" dyno= connect= service= status=503 bytes= protocol=https
2022-08-09T06:31:43.201958+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=examplerails.herokuapp.com request_id=8bc32463-dd26-4a1e-bc7f-483b72d91fa4 fwd="102.89.41.87" dyno= connect= service= status=503 bytes= protocol=https
2022-08-09T06:34:41.603649+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=examplerails.herokuapp.com request_id=1b7339b2-9706-479e-8ba9-3a29392a05a8 fwd="102.89.41.87" dyno= connect= service= status=503 bytes= protocol=https
2022-08-09T06:34:41.882759+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=examplerails.herokuapp.com request_id=a6ad6b2c-2cb5-4fd9-a803-1fc1ebf36b17 fwd="102.89.41.87" dyno= connect= service= status=503 bytes= protocol=https
2022-08-09T06:43:46.049127+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=examplerails.herokuapp.com request_id=c282cc3b-2f7e-4010-9f96-ddc996c87abd fwd="102.89.41.87" dyno= connect= service= status=503 bytes= protocol=https
2022-08-09T06:43:46.314701+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=examplerails.herokuapp.com request_id=3a12bb5a-2b46-433c-997e-a9b6bcdcb18f fwd="102.89.41.87" dyno= connect= service= status=503 bytes= protocol=https
2022-08-09T06:48:44.746660+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=examplerails.herokuapp.com request_id=6c61c7ce-f69e-43de-aed5-40d5f85239a1 fwd="102.89.41.87" dyno= connect= service= status=503 bytes= protocol=https
2022-08-09T06:48:45.250757+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=examplerails.herokuapp.com request_id=b4656eff-d125-4225-90fd-fb8e14cdf5ea fwd="102.89.41.87" dyno= connect= service= status=503 bytes= protocol=https







``

 

 **or is it from this line of logs?**

 


``
from config.ru:3:in `require_relative'
2022-08-09T02:17:27.936748+00:00 app[web.1]: from config.ru:3:in `block in <main>'
2022-08-09T02:17:27.936755+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-08-09T02:17:27.936764+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-08-09T02:17:27.936766+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-08-09T02:17:27.936773+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-08-09T02:17:27.936775+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-08-09T02:17:27.936776+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-08-09T02:17:27.936791+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-08-09T02:17:27.936791+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-08-09T02:17:27.936792+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-08-09T02:17:27.936794+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-08-09T02:17:27.936794+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/commands/server/server_command.rb:38:in `start'
2022-08-09T02:17:27.936803+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/commands/server/server_command.rb:143:in `block in perform'
2022-08-09T02:17:27.936805+00:00 app[web.1]: from <internal:kernel>:90:in `tap'
2022-08-09T02:17:27.936807+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/commands/server/server_command.rb:134:in `perform'
2022-08-09T02:17:27.936809+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-08-09T02:17:27.936817+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-08-09T02:17:27.936819+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-08-09T02:17:27.936820+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/command/base.rb:87:in `perform'
2022-08-09T02:17:27.936828+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/command.rb:48:in `invoke'
2022-08-09T02:17:27.936830+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/commands.rb:18:in `<main>'
2022-08-09T02:17:27.936837+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-08-09T02:17:27.936839+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-08-09T02:17:27.936841+00:00 app[web.1]: from bin/rails:4:in `<main>'










``

后来在终端上用这个命令解决了

$heroku run rails console

谢谢!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM