Joseph Parker
Joseph Parker

Reputation: 35

Deploying Rails app to Heroku build succeeded but still has error

I am trying to deploy my rails app to Heroku and i get build succeeded but when I go to open the app it says application error.

Not sure what I am doing wrong I can run it locally through rails server and get it to start up but it throws an error when deployed to Heroku

Ok. I updated a few things and when I rain heroku logs --tail i get the below? If anyone can help.

2019-10-08T01:52:43.687425+00:00 app[api]: Initial release by user [email protected]
2019-10-08T01:52:44.026706+00:00 app[api]: Enable Logplex by user [email protected]
2019-10-08T01:52:44.026706+00:00 app[api]: Release v2 created by user [email protected]
2019-10-08T01:52:43.687425+00:00 app[api]: Release v1 created by user [email protected]
2019-10-08T01:53:36.858969+00:00 app[api]: Set RAILS_MASTER_KEY config vars by user [email protected]
2019-10-08T01:53:36.858969+00:00 app[api]: Release v3 created by user [email protected]
2019-10-08T01:53:50+00:00 app[api]: Build started by user [email protected]
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 [email protected]
2019-10-08T01:55:04.56063+00:00 app[api]: Release v4 created by user [email protected]
2019-10-08T01:55:08.762442+00:00 app[api]: Attach DATABASE (@ref:postgresql-parallel-30842) by user [email protected]
2019-10-08T01:55:08.780205+00:00 app[api]: Release v6 created by user [email protected]
2019-10-08T01:55:08.762442+00:00 app[api]: Running release v5 commands by user [email protected]
2019-10-08T01:55:08.780205+00:00 app[api]: @ref:postgresql-parallel-30842 completed provisioning, setting DATABASE_URL. by user [email protected]
2019-10-08T01:55:09.082862+00:00 app[api]: Release v7 created by user [email protected]
2019-10-08T01:55:09.098495+00:00 app[api]: Scaled to console@0:Free rake@0:Free web@1:Free by user [email protected]
2019-10-08T01:55:09.082862+00:00 app[api]: Deploy 695632eb by user [email protected]
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'

Upvotes: 0

Views: 313

Answers (1)

user8599704
user8599704

Reputation:

The errors that the heroku console is giving to you are more in to Heroku rules for production:

Warning #1 You have a x86-mingw32 in yor gemfile. I had the same error to and it must be removed so it can not have conflect with heroku pushes. Please see Heroku Removing Gemfile.lock because it was generated on Windows

Warning #2 Heroku has not detected some bucket for your app. What is telling you is that if you upload a file, a image or some any uploadable it won't las that much time. You will see it for only some minutes and then it will disappear. I recommend some AWS Bucket service you can see it here: https://medium.com/alturasoluciones/setting-up-rails-5-active-storage-with-amazon-s3-3d158cf021ff

Warning #3 This warning is kinda related to the second one, you need to add Herokus buildpack for activeStorage:

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

Whenever you have two types of enviorments you need to have separated builds for each to work. Please see: https://blog.heroku.com/rails-active-storage https://github.com/heroku/heroku-buildpack-activestorage-preview

Warning #4 This is a commun error that dosen't affect your code, but sometimes it's quite annoying. The error specifies to use a procfile which in that file you need to specifies what are you using to boot your app. In this case it's puma for most of the rails Apps. I highly recommend seeing: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server

Follow this simple steps in order heroku knows what service your are using for booting up you heroku app.

Hope this works for you. Happy coding!!

Upvotes: 4

Related Questions