成功构建但进程以状态 1 退出,在 heroku 上部署 rails 应用程序

Posted

技术标签:

【中文标题】成功构建但进程以状态 1 退出,在 heroku 上部署 rails 应用程序【英文标题】:Successful build but process exited with status 1, deploying rails app on heroku 【发布时间】:2019-07-18 08:33:10 【问题描述】:

构建成功后出现以下错误。有关如何解决此错误的任何想法?

2019-02-24T23:51:17.000000+00:00 app[api]:构建由用户 timdom11@gmail.com 开始 2019-02-24T23:51:41.818679+00:00 app[api]:由用户 timdom11@gmail.com 创建的版本 v16 2019-02-24T23:51:41.818679+00:00 app[api]:由用户 timdom11@gmail.com 部署 2096254f 2019-02-24T23:51:42.540367+00:00 heroku[web.1]:状态从崩溃变为启动 2019-02-24T23:51:44.000000+00:00 app[api]:构建成功 2019-02-24T23:51:48.259082+00:00 heroku[web.1]:启动过程 命令bin/rails server -p 23822 -e production 2019-02-24T23:51:53.313462+00:00 heroku[web.1]:状态从 开始崩溃 2019-02-24T23:51:53.221432+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/ core_ext/active_support.rb:76:in block in load_missing_constant: 未初始化的常量敲击 (名称错误) 2019-02-24T23:51:53.221452+00:00 app[web.1]: 来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in without_bootsnap_cache 2019-02-24T23:51:53.221697+00:00 app[web.1]: 来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:76:in rescue in load_missing_constant 2019-02-24T23:51:53.221700+00:00 应用程序 [web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache /core_ext/active_support.rb:58:in load_missing_constant 2019-02-24T23:51:53.221702+00:00 app[web.1]: 来自 /app/app/controllers/user_token_controller.rb:1:in <main> 2019-02-24T23:51:53.221704+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require 2019-02-24T23:51:53.221706+00:00 应用程序[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache /core_ext/kernel_require.rb:21:in block in require_with_bootsnap_lfi 2019-02-24T23:51:53.221842+00:00 应用程序 [web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache /loaded_features_index.rb:83:in register 2019-02-24T23:51:53.221844+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in require_with_bootsnap_lfi 2019-02-24T23:51:53.221846+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require 2019-02-24T23:51:53.221848+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:14:in block in loading 2019-02-24T23:51:53.221850+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/concurrency/share_lock.rb:151:in exclusive 2019-02-24T23:51:53.221858+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:13:in loading 2019-02-24T23:51:53.221860+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:48:in block in require_or_load 2019-02-24T23:51:53.221862+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in allow_bootsnap_retry 2019-02-24T23:51:53.221863+00:00 应用[web.1]: 从 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:47:in require_or_load 2019-02-24T23:51:53.221865+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:82:in depend_on 2019-02-24T23:51:53.221866+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:478:in block (2 levels) in eager_load! 2019-02-24T23:51:53.221868+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:477:in each 2019-02-24T23:51:53.221870+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:477:in block in eager_load! 2019-02-24T23:51:53.221923+00:00 应用[web.1]: 从 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:475:in each 2019-02-24T23:51:53.221926+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:475:in eager_load! 2019-02-24T23:51:53.221927+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:356:in eager_load! 2019-02-24T23:51:53.221929+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application/finisher.rb:69:in each 2019-02-24T23:51:53.221930+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application/finisher.rb:69:in block in <module:Finisher> 2019-02-24T23:51:53.221932+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:32:in instance_exec 2019-02-24T23:51:53.221933+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:32:in run 2019-02-24T23:51:53.221935+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:61:in block in run_initializers 2019-02-24T23:51:53.221936+00:00 应用[web.1]:来自 /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:228:in block in tsort_each 2019-02-24T23:51:53.221938+00:00 应用[web.1]:来自 /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component 2019-02-24T23:51:53.221939+00:00 应用[web.1]:来自 /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:431:in each_strongly_connected_component_from 2019-02-24T23:51:53.221941+00:00 app[web.1]: 来自 /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:349:in block in each_strongly_connected_component 2019-02-24T23:51:53.221943+00:00 应用[web.1]:来自 /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:347:in each 2019-02-24T23:51:53.221944+00:00 app[web.1]: 来自 /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:347:in call 2019-02-24T23:51:53.221950+00:00 应用[web.1]:来自 /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:347:in each_strongly_connected_component 2019-02-24T23:51:53.221952+00:00 应用[web.1]:来自 /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:226:in tsort_each 2019-02-24T23:51:53.221954+00:00 应用[web.1]:来自 /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:205:in tsort_each 2019-02-24T23:51:53.221955+00:00 应用程序[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:60:in run_initializers 2019-02-24T23:51:53.221957+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application.rb:361:in initialize! 2019-02-24T23:51:53.221959+00:00 应用[web.1]:来自 /app/config/environment.rb:5:in <main> 2019-02-24T23:51:53.221960+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require 2019-02-24T23:51:53.221963+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in block in require_with_bootsnap_lfi 2019-02-24T23:51:53.221965+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in register 2019-02-24T23:51:53.221966+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in require_with_bootsnap_lfi 2019-02-24T23:51:53.221974+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require 2019-02-24T23:51:53.221975+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in require_relative 2019-02-24T23:51:53.221977+00:00 应用[web.1]:来自 config.ru:3:in block in <main> 2019-02-24T23:51:53.221979+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in instance_eval 2019-02-24T23:51:53.221981+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in initialize 2019-02-24T23:51:53.221983+00:00 应用[web.1]:来自 config.ru:in new 2019-02-24T23:51:53.221984+00:00 应用[web.1]:来自 config.ru:in <main> 2019-02-24T23:51:53.221986+00:00 应用[web.1]: 从 /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in eval 2019-02-24T23:51:53.221988+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in new_from_string 2019-02-24T23:51:53.221989+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:40:in parse_file 2019-02-24T23:51:53.221991+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:319:in build_app_and_options_from_config 2019-02-24T23:51:53.221993+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:219:in app 2019-02-24T23:51:53.221994+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:27:in app 2019-02-24T23:51:53.221996+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:354:in wrapped_app 2019-02-24T23:51:53.221997+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:283:in start 2019-02-24T23:51:53.221999+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:53:in start 2019-02-24T23:51:53.222001+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:147:in block in perform 2019-02-24T23:51:53.222002+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in tap 2019-02-24T23:51:53.222004+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in perform 2019-02-24T23:51:53.222005+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in run 2019-02-24T23:51:53.222007+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command 2019-02-24T23:51:53.222009+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in dispatch 2019-02-24T23:51:53.222010+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/command/base.rb:65:in perform 2019-02-24T23:51:53.222012+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/command.rb:46:in invoke 2019-02-24T23:51:53.222014+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/commands.rb:18:in <main> 2019-02-24T23:51:53.222015+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require 2019-02-24T23:51:53.222017+00:00 应用程序[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in block in require_with_bootsnap_lfi 2019-02-24T23:51:53.222018+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in register 2019-02-24T23:51:53.222020+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in require_with_bootsnap_lfi 2019-02-24T23:51:53.222022+00:00 应用[web.1]:来自 /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require 2019-02-24T23:51:53.222023+00:00 app[web.1]: 来自 bin/rails:9:in <main> 2019-02-24T23:51:53.223670+00:00 app[web.1]: => 启动 Puma 2019-02-24T23:51:53.223672+00:00 app[web.1]: => Rails 5.2.2 应用程序开始生产2019-02-24T23:51:53.223673+00 :00 app[web.1]: => 运行rails server -h 更多启动选项 2019-02-24T23:51:53.223675+00:00 app[web.1]:退出 2019-02-24T23:51:53.294763+00:00 heroku[web.1]:进程退出,状态为 1

【问题讨论】:

加载页面时出现以下错误:2019-02-24T23:47:53.992508+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path ="/" host=existentialeconomics.herokuapp.com request_id=09b61985-1abe-4768-815b-7bdfc6365e56 fwd="196.61.107.103" dyno= connect= service= status=503 bytes= protocol=https 2019-02-24T23:47 :55.296178+00:00 heroku[路由器]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=existentialeconomics.herokuapp.com request_id=27d73df4-aea6-4de7-b835 -58fdff3ae1a0 fwd="196.61.107.103" dyno= connect= service= status=503 bytes= protocol=https 【参考方案1】:

我发现了错误。我导致崩溃的身份验证方法。修复此问题后,网站运行完美。

【讨论】:

以上是关于成功构建但进程以状态 1 退出,在 heroku 上部署 rails 应用程序的主要内容,如果未能解决你的问题,请参考以下文章

xcodebuild 成功时退出状态为 1

Node.js 应用程序无法在 heroku 上启动

通过sed管道输出但保留退出状态[重复]

Sencha 构建失败的指南针进程以非零代码 1 退出

如果任何作业在 python 中失败,如何退出进程?

NodeJS 应用程序构建成功(Heroku),但启动时 Heroku 中的应用程序错误