成功构建但进程以状态 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:inblock 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:inwithout_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:inrescue 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:inload_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:inrequire
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:inblock 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:inregister
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:inrequire_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:inrequire
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:inblock 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:inexclusive
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:inloading
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:inblock 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:inallow_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:inrequire_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:independ_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:inblock (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:ineach
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:inblock 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:ineach
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:ineager_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:ineager_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:ineach
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:inblock 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:ininstance_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:inrun
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:inblock 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:inblock 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:inblock (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:ineach_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:inblock 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:ineach
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:incall
2019-02-24T23:51:53.221950+00:00 应用[web.1]:来自 /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:347:ineach_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:intsort_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:intsort_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:inrun_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:ininitialize!
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:inrequire
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:inblock 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:inregister
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:inrequire_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:inrequire
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:inrequire_relative
2019-02-24T23:51:53.221977+00:00 应用[web.1]:来自 config.ru:3:inblock 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:ininstance_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:ininitialize
2019-02-24T23:51:53.221983+00:00 应用[web.1]:来自 config.ru:innew
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:ineval
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:innew_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:inparse_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:inbuild_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:inapp
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:inapp
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:inwrapped_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:instart
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:instart
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:inblock 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:intap
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:inperform
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:inrun
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:ininvoke_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:indispatch
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:inperform
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:ininvoke
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:inrequire
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:inblock 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:inregister
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:inrequire_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:inrequire
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 应用程序的主要内容,如果未能解决你的问题,请参考以下文章