Развертывание Rails-приложения в сборку Heroku выполнено успешно, но все еще имеет ошибку - PullRequest
0 голосов
/ 03 октября 2019

Я пытаюсь развернуть приложение rails на Heroku, и сборка прошла успешно, но когда я открываю приложение, появляется сообщение об ошибке приложения.

Не уверен, что я делаю неправильно, я могу запустить его локально через сервер rails и запустить его, но он выдает ошибку при развертывании на Heroku

ОК. Я обновил несколько вещей, и когда я иду дождь герои журналы - хвост, я получаю ниже? Если кто-нибудь может помочь.

2019-10-08T01:52:43.687425+00:00 app[api]: Initial release by user jparker010190@gmail.com
2019-10-08T01:52:44.026706+00:00 app[api]: Enable Logplex by user jparker010190@gmail.com
2019-10-08T01:52:44.026706+00:00 app[api]: Release v2 created by user jparker010190@gmail.com
2019-10-08T01:52:43.687425+00:00 app[api]: Release v1 created by user jparker010190@gmail.com
2019-10-08T01:53:36.858969+00:00 app[api]: Set RAILS_MASTER_KEY config vars by user jparker010190@gmail.com
2019-10-08T01:53:36.858969+00:00 app[api]: Release v3 created by user jparker010190@gmail.com
2019-10-08T01:53:50+00:00 app[api]: Build started by user jparker010190@gmail.com
2019-10-08T01:55:04.56063+00:00 app[api]: Set LANG, RACK_ENV, RAILS_ENV, RAILS_LOG_TO_STDOUT, RAILS_SERVE_STATIC_FILES, SECRET_KEY_BASE config vars by user jparker010190@gmail.com
2019-10-08T01:55:04.56063+00:00 app[api]: Release v4 created by user jparker010190@gmail.com
2019-10-08T01:55:08.762442+00:00 app[api]: Attach DATABASE (@ref:postgresql-parallel-30842) by user jparker010190@gmail.com
2019-10-08T01:55:08.780205+00:00 app[api]: Release v6 created by user jparker010190@gmail.com
2019-10-08T01:55:08.762442+00:00 app[api]: Running release v5 commands by user jparker010190@gmail.com
2019-10-08T01:55:08.780205+00:00 app[api]: @ref:postgresql-parallel-30842 completed provisioning, setting DATABASE_URL. by user jparker010190@gmail.com
2019-10-08T01:55:09.082862+00:00 app[api]: Release v7 created by user jparker010190@gmail.com
2019-10-08T01:55:09.098495+00:00 app[api]: Scaled to console@0:Free rake@0:Free web@1:Free by user jparker010190@gmail.com
2019-10-08T01:55:09.082862+00:00 app[api]: Deploy 695632eb by user jparker010190@gmail.com
2019-10-08T01:55:12+00:00 app[api]: Build succeeded
2019-10-08T01:55:13.770271+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 36416 -e production`
2019-10-08T01:55:18.284625+00:00 heroku[web.1]: source=web.1 dyno=heroku.148880573.2937adaf-dcc2-412a-910b-76ef37afae84 sample#memory_total=87.51MB sample#memory_rss=64.64MB sample#memory_cache=22.87MB sample#memory_swap=0.00MB sample#memory_pgpgin=23091pages sample#memory_pgpgout=689pages sample#memory_quota=512.00MB
2019-10-08T01:55:19.982554+00:00 heroku[web.1]: Process exited with status 1
2019-10-08T01:55:20.040594+00:00 heroku[web.1]: State changed from starting to crashed
2019-10-08T01:55:20.044168+00:00 heroku[web.1]: State changed from crashed to starting
2019-10-08T01:55:19.912352+00:00 app[web.1]: /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt': ActiveSupport::MessageEncryptor::InvalidMessage (ActiveSupport::MessageEncryptor::InvalidMessage)
2019-10-08T01:55:19.912394+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:183:in `_decrypt'
2019-10-08T01:55:19.912418+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
2019-10-08T01:55:19.91242+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
2019-10-08T01:55:19.912422+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_file.rb:79:in `decrypt'
2019-10-08T01:55:19.91243+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_file.rb:42:in `read'
2019-10-08T01:55:19.912432+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:21:in `read'
2019-10-08T01:55:19.912434+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:33:in `config'
2019-10-08T01:55:19.912436+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/encrypted_configuration.rb:38:in `options'
2019-10-08T01:55:19.912438+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
2019-10-08T01:55:19.912449+00:00 app[web.1]: from (erb):12:in `<main>'
2019-10-08T01:55:19.912463+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/erb.rb:901:in `eval'
2019-10-08T01:55:19.912466+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/erb.rb:901:in `result'
2019-10-08T01:55:19.912468+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activestorage-5.2.3/lib/active_storage/engine.rb:95:in `block (2 levels) in <class:Engine>'
2019-10-08T01:55:19.91247+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
2019-10-08T01:55:19.912472+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
2019-10-08T01:55:19.912474+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
2019-10-08T01:55:19.912476+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
2019-10-08T01:55:19.912478+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
2019-10-08T01:55:19.91248+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:51:in `each'
2019-10-08T01:55:19.912482+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
2019-10-08T01:55:19.912484+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activestorage-5.2.3/app/models/active_storage/blob.rb:235:in `<class:Blob>'
2019-10-08T01:55:19.912486+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activestorage-5.2.3/app/models/active_storage/blob.rb:16:in `<main>'
2019-10-08T01:55:19.912488+00:00 app[web.1]: 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'
2019-10-08T01:55:19.912495+00:00 app[web.1]: 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'
2019-10-08T01:55:19.912498+00:00 app[web.1]: 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'
2019-10-08T01:55:19.9125+00:00 app[web.1]: 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'
2019-10-08T01:55:19.912502+00:00 app[web.1]: 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'
2019-10-08T01:55:19.912503+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
2019-10-08T01:55:19.912505+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
2019-10-08T01:55:19.912507+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
2019-10-08T01:55:19.91251+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:378:in `block in require_or_load'
2019-10-08T01:55:19.912511+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:37:in `block in load_interlock'
2019-10-08T01:55:19.912514+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
2019-10-08T01:55:19.912516+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
2019-10-08T01:55:19.912519+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:13:in `loading'
2019-10-08T01:55:19.912521+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:37:in `load_interlock'
2019-10-08T01:55:19.912522+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:356:in `require_or_load'
2019-10-08T01:55:19.912524+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:48:in `block in require_or_load'
2019-10-08T01:55:19.912526+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
2019-10-08T01:55:19.912528+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:47:in `require_or_load'
2019-10-08T01:55:19.91253+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:334:in `depend_on'
2019-10-08T01:55:19.912532+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:85:in `depend_on'
2019-10-08T01:55:19.912534+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:246:in `require_dependency'
2019-10-08T01:55:19.912542+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
2019-10-08T01:55:19.912555+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:477:in `each'
2019-10-08T01:55:19.912557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:477:in `block in eager_load!'
2019-10-08T01:55:19.912559+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:475:in `each'
2019-10-08T01:55:19.912561+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:475:in `eager_load!'
2019-10-08T01:55:19.912563+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:356:in `eager_load!'
2019-10-08T01:55:19.912565+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application/finisher.rb:69:in `each'
2019-10-08T01:55:19.912568+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
2019-10-08T01:55:19.912569+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
2019-10-08T01:55:19.912571+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
2019-10-08T01:55:19.912573+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
2019-10-08T01:55:19.912575+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
2019-10-08T01:55:19.912577+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2019-10-08T01:55:19.912579+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
2019-10-08T01:55:19.912581+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
2019-10-08T01:55:19.912583+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each'
2019-10-08T01:55:19.912585+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `call'
2019-10-08T01:55:19.912587+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
2019-10-08T01:55:19.912589+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
2019-10-08T01:55:19.912591+00:00 app[web.1]: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
2019-10-08T01:55:19.912593+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
2019-10-08T01:55:19.912595+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
2019-10-08T01:55:19.912603+00:00 app[web.1]: from /app/config/environment.rb:5:in `<main>'
2019-10-08T01:55:19.912606+00:00 app[web.1]: 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'
2019-10-08T01:55:19.912608+00:00 app[web.1]: 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'
2019-10-08T01:55:19.91261+00:00 app[web.1]: 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'
2019-10-08T01:55:19.912612+00:00 app[web.1]: 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'
2019-10-08T01:55:19.912614+00:00 app[web.1]: 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'
2019-10-08T01:55:19.912616+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
2019-10-08T01:55:19.912618+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
2019-10-08T01:55:19.912625+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
2019-10-08T01:55:19.912628+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `require_relative'
2019-10-08T01:55:19.91263+00:00 app[web.1]: from config.ru:3:in `block in <main>'
2019-10-08T01:55:19.912632+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `instance_eval'

1 Ответ

4 голосов
/ 03 октября 2019

Ошибки, которые выдает консоль heroku, больше соответствуют правилам производства Heroku:

Предупреждение # 1 У вас есть x86-mingw32 в вашем гемфайле. У меня была такая же ошибка, и она должна быть удалена, чтобы ее нельзя было спутать с толчками героку. См. Heroku Удаление Gemfile.lock, поскольку он был сгенерирован в Windows

Предупреждение # 2 Heroku не обнаружил какую-либо корзину для вашего приложения. Что говорит вам, это то, что если вы загрузите файл, изображение или какой-либо другой загружаемый файл, это не займет много времени. Вы увидите его всего несколько минут, а затем он исчезнет. Я рекомендую некоторые сервисы AWS Bucket, вы можете увидеть их здесь: https://medium.com/alturasoluciones/setting-up-rails-5-active-storage-with-amazon-s3-3d158cf021ff

Предупреждение # 3 Это предупреждение в некоторой степени связано со вторым, вам нужно добавить Herokus buildpack для activeStorage:

heroku buildpacks:add -i 1 https://github.com/heroku/heroku-buildpack-activestorage-preview

Всякий раз, когда у вас есть два типа окружения, вы должны иметь отдельные сборки для каждого для работы. Пожалуйста, смотрите: https://blog.heroku.com/rails-active-storage https://github.com/heroku/heroku-buildpack-activestorage-preview

Warning # 4 Это коммандная ошибка, которая не влияет на ваш код, но иногда это довольно раздражает. Ошибка указывает на использование procfile, который в этом файле вам нужно указать, что вы используете для загрузки вашего приложения. В данном случае это пума для большинства рельсовых приложений. Я настоятельно рекомендую посмотреть: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server

Следуйте этим простым шагам, чтобы heroku узнала, какой сервис вы используете для загрузки своего приложения heroku.

Надеюсь, это работает для вас. Удачного кодирования !!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...